Lines Matching refs:once_control
47 * on once_control shall be as if pthread_once() was never called.
53 pthread_once_t *once_control = arg;
55 if (atomic_cmpset_rel_int(&once_control->state, ONCE_IN_PROGRESS, ONCE_NEVER_DONE))
57 atomic_store_rel_int(&once_control->state, ONCE_NEVER_DONE);
58 _thr_umtx_wake(&once_control->state, INT_MAX, 0);
62 _pthread_once(pthread_once_t *once_control, void (*init_routine) (void))
70 state = once_control->state;
74 if (atomic_cmpset_acq_int(&once_control->state, state, ONCE_IN_PROGRESS))
77 if (atomic_cmpset_acq_int(&once_control->state, state, ONCE_WAIT))
78 _thr_umtx_wait_uint(&once_control->state, ONCE_WAIT, NULL, 0);
80 _thr_umtx_wait_uint(&once_control->state, state, NULL, 0);
86 THR_CLEANUP_PUSH(curthread, once_cancel_handler, once_control);
89 if (atomic_cmpset_rel_int(&once_control->state, ONCE_IN_PROGRESS, ONCE_DONE))
91 atomic_store_rel_int(&once_control->state, ONCE_DONE);
92 _thr_umtx_wake(&once_control->state, INT_MAX, 0);