зеркало из https://github.com/mozilla/gecko-dev.git
In _PR_InitThreads, call pthread_init to explicitly initialize the
pthread subsystem on BSD/OS because pthread_self() fails to initialize pthreads implicitly. This patch is contributed by Bert Driehuis <bert_driehuis@nl.compuware.com>.
This commit is contained in:
Родитель
cb5076cfe2
Коммит
b29446a65f
|
@ -32,6 +32,7 @@ RANLIB = ranlib
|
|||
|
||||
ifeq ($(USE_PTHREADS),1)
|
||||
IMPL_STRATEGY = _PTH
|
||||
DEFINES += -D_PR_NEED_PTHREAD_INIT
|
||||
else
|
||||
IMPL_STRATEGY = _EMU
|
||||
DEFINES += -D_PR_LOCAL_THREADS_ONLY
|
||||
|
|
|
@ -745,6 +745,17 @@ void _PR_InitThreads(
|
|||
int rv;
|
||||
PRThread *thred;
|
||||
|
||||
#ifdef _PR_NEED_PTHREAD_INIT
|
||||
/*
|
||||
* On BSD/OS (3.1 and 4.0), the pthread subsystem is lazily
|
||||
* initialized, but pthread_self() fails to initialize
|
||||
* pthreads and hence returns a null thread ID if invoked
|
||||
* by the primordial thread before any other pthread call.
|
||||
* So we explicitly initialize pthreads here.
|
||||
*/
|
||||
pthread_init();
|
||||
#endif
|
||||
|
||||
#if defined(_PR_DCETHREADS) || defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
|
||||
/*
|
||||
** These might be function evaluations
|
||||
|
|
Загрузка…
Ссылка в новой задаче