summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Rabson <dfr@FreeBSD.org>2000-07-21 09:31:13 +0000
committerDoug Rabson <dfr@FreeBSD.org>2000-07-21 09:31:13 +0000
commit678ef1b49eb8de71bea62013193bb8f49c5e3811 (patch)
treec00a90e2c23aaa9a9e6f0166e6de86233a9b3d5e
parenta606bbf4c867581b350d9e06b25d78b9177911a4 (diff)
Notes
-rw-r--r--lib/libc_r/uthread/uthread_once.c2
-rw-r--r--lib/libkse/thread/thr_once.c2
-rw-r--r--lib/libpthread/thread/thr_once.c2
3 files changed, 6 insertions, 0 deletions
diff --git a/lib/libc_r/uthread/uthread_once.c b/lib/libc_r/uthread/uthread_once.c
index ea56d82c4d83..d7bb494b6741 100644
--- a/lib/libc_r/uthread/uthread_once.c
+++ b/lib/libc_r/uthread/uthread_once.c
@@ -39,6 +39,8 @@ int
pthread_once(pthread_once_t * once_control, void (*init_routine) (void))
{
if (once_control->state == PTHREAD_NEEDS_INIT) {
+ if (_thread_initial == NULL)
+ _thread_init();
pthread_mutex_lock(&(once_control->mutex));
if (once_control->state == PTHREAD_NEEDS_INIT) {
init_routine();
diff --git a/lib/libkse/thread/thr_once.c b/lib/libkse/thread/thr_once.c
index ea56d82c4d83..d7bb494b6741 100644
--- a/lib/libkse/thread/thr_once.c
+++ b/lib/libkse/thread/thr_once.c
@@ -39,6 +39,8 @@ int
pthread_once(pthread_once_t * once_control, void (*init_routine) (void))
{
if (once_control->state == PTHREAD_NEEDS_INIT) {
+ if (_thread_initial == NULL)
+ _thread_init();
pthread_mutex_lock(&(once_control->mutex));
if (once_control->state == PTHREAD_NEEDS_INIT) {
init_routine();
diff --git a/lib/libpthread/thread/thr_once.c b/lib/libpthread/thread/thr_once.c
index ea56d82c4d83..d7bb494b6741 100644
--- a/lib/libpthread/thread/thr_once.c
+++ b/lib/libpthread/thread/thr_once.c
@@ -39,6 +39,8 @@ int
pthread_once(pthread_once_t * once_control, void (*init_routine) (void))
{
if (once_control->state == PTHREAD_NEEDS_INIT) {
+ if (_thread_initial == NULL)
+ _thread_init();
pthread_mutex_lock(&(once_control->mutex));
if (once_control->state == PTHREAD_NEEDS_INIT) {
init_routine();