src/lib/libthr/thread/thr_once.c
/*
 * POSIX:
 * The pthread_once() function is not a cancellation point. However,
 * if init_routine is a cancellation point and is canceled, the effect
 * on once_control shall be as if pthread_once() was never called.
 */
The pthread_once() function is not a cancellation point. However,
if init_routine is a cancellation point and is canceled, the effect
on once_control shall be as if pthread_once() was never called.
The pthread_once () function is not a cancellation point . However if init_routine is a cancellation point and is canceled the effect on once_control shall be as if pthread_once () was never called .
static void
once_cancel_handler(void *arg)
{
	pthread_once_t *once_control;
	once_control = arg;
	if (atomic_cmpset_rel_int(&once_control->state, ONCE_IN_PROGRESS,
	    ONCE_NEVER_DONE))
		return;
	atomic_store_rel_int(&once_control->state, ONCE_NEVER_DONE);
	_thr_umtx_wake(&once_control->state, INT_MAX, 0);
}
static void once_cancel_handler ( void * arg ) { pthread_once_t * once_control ; once_control = arg ; if ( atomic_cmpset_rel_int ( & once_control -> state , ONCE_IN_PROGRESS , ONCE_NEVER_DONE ) ) return ; atomic_store_rel_int ( & once_control -> state , ONCE_NEVER_DONE ) ; _thr_umtx_wake ( & once_control -> state , INT_MAX , 0 ) ; }
POSIX:
 The pthread_once() function is not a cancellation point.
POSIX : The pthread_once () function is not a cancellation point .