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:
wtc%netscape.com 1999-02-01 20:01:36 +00:00
Родитель cb5076cfe2
Коммит b29446a65f
2 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -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