diff options
Diffstat (limited to 'lib/libpthread')
-rw-r--r-- | lib/libpthread/thread/thr_once.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libpthread/thread/thr_once.c b/lib/libpthread/thread/thr_once.c index ea56d82..d7bb494 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(); |