123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- #include "pthreadP.h"
- #include <lowlevellock.h>
- static lll_lock_t once_lock = LLL_LOCK_INITIALIZER;
- int
- __pthread_once (
- pthread_once_t *once_control,
- void (*init_routine) (void))
- {
-
- if (*once_control == PTHREAD_ONCE_INIT)
- {
- lll_lock (once_lock);
-
- if (*once_control == PTHREAD_ONCE_INIT)
- {
- init_routine ();
- *once_control = !PTHREAD_ONCE_INIT;
- }
- lll_unlock (once_lock);
- }
- return 0;
- }
- strong_alias (__pthread_once, pthread_once)
|