From cccbd286e927a6a92e8f7231e57ddd17a243314f Mon Sep 17 00:00:00 2001 From: Philip Guenther Date: Tue, 5 Sep 2017 02:40:56 +0000 Subject: Move mutex, condvar, and thread-specific data routes, pthread_once, and pthread_exit from libpthread to libc, along with low-level bits to support them. Major bump to both libc and libpthread. Requested by libressl team. Ports testing by naddy@ ok kettenis@ --- lib/librthread/rthread_np.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/librthread/rthread_np.c') diff --git a/lib/librthread/rthread_np.c b/lib/librthread/rthread_np.c index d8a78110358..86beb501068 100644 --- a/lib/librthread/rthread_np.c +++ b/lib/librthread/rthread_np.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rthread_np.c,v 1.19 2016/05/07 19:05:22 guenther Exp $ */ +/* $OpenBSD: rthread_np.c,v 1.20 2017/09/05 02:40:54 guenther Exp $ */ /* * Copyright (c) 2004,2005 Ted Unangst * Copyright (c) 2005 Otto Moerbeek @@ -80,6 +80,9 @@ pthread_stackseg_np(pthread_t thread, stack_t *sinfo) static struct rlimit rl; static int gotself; + if (!_threads_ready) /* for ROUND_TO_PAGE */ + _rthread_init(); + if (gotself == 0) { int mib[2]; size_t len; -- cgit v1.2.3