diff options
Diffstat (limited to 'lib/libthr/thread/thr_init.c')
-rw-r--r-- | lib/libthr/thread/thr_init.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c index b59678c3f6c3..0f9e3749d75f 100644 --- a/lib/libthr/thread/thr_init.c +++ b/lib/libthr/thread/thr_init.c @@ -33,7 +33,7 @@ * SUCH DAMAGE. */ -#include <sys/cdefs.h> +#define _WANT_P_OSREL #include "namespace.h" #include <sys/param.h> #include <sys/auxv.h> @@ -60,6 +60,7 @@ #include "libc_private.h" #include "thr_private.h" +int __getosreldate(void); char *_usrstack; struct pthread *_thr_initial; int _libthr_debug; @@ -169,7 +170,6 @@ STATIC_LIB_REQUIRE(_sem_trywait); STATIC_LIB_REQUIRE(_sem_wait); STATIC_LIB_REQUIRE(_sigaction); STATIC_LIB_REQUIRE(_sigprocmask); -STATIC_LIB_REQUIRE(_sigsuspend); STATIC_LIB_REQUIRE(_sigtimedwait); STATIC_LIB_REQUIRE(_sigwait); STATIC_LIB_REQUIRE(_sigwaitinfo); @@ -272,6 +272,8 @@ static pthread_func_t jmp_table[][2] = { [PJT_GETTHREADID_NP] = {DUAL_ENTRY(_thr_getthreadid_np)}, [PJT_ATTR_GET_NP] = {DUAL_ENTRY(_thr_attr_get_np)}, [PJT_GETNAME_NP] = {DUAL_ENTRY(_thr_getname_np)}, + [PJT_SUSPEND_ALL_NP] = {DUAL_ENTRY(_thr_suspend_all_np)}, + [PJT_RESUME_ALL_NP] = {DUAL_ENTRY(_thr_resume_all_np)}, }; static int init_once = 0; @@ -333,6 +335,8 @@ _libpthread_init(struct pthread *curthread) /* Set the initial thread. */ if (curthread == NULL) { first = 1; + /* Force _get_curthread() return NULL until set. */ + _tcb_get()->tcb_thread = NULL; /* Create and initialize the initial thread. */ curthread = _thr_alloc(NULL); if (curthread == NULL) @@ -349,7 +353,7 @@ _libpthread_init(struct pthread *curthread) _thread_active_threads = 1; /* Setup the thread specific data */ - _tcb_set(curthread->tcb); + __thr_setup_tsd(curthread); if (first) { _thr_initial = curthread; @@ -430,6 +434,10 @@ init_main_thread(struct pthread *thread) thread->unwind_stackend = _usrstack; #endif + thread->uexterr.ver = UEXTERROR_VER; + if (__getosreldate() >= P_OSREL_EXTERRCTL) + exterrctl(EXTERRCTL_ENABLE, EXTERRCTLF_FORCE, &thread->uexterr); + /* Others cleared to zero by thr_alloc() */ } @@ -520,7 +528,6 @@ init_private(void) env = getenv("LIBPTHREAD_QUEUE_FIFO"); if (env) _thr_queuefifo = atoi(env); - TAILQ_INIT(&_thr_atfork_list); env = getenv("LIBPTHREAD_UMTX_MIN_TIMEOUT"); if (env) { char *endptr; |