pthread_once_t *once_control = arg;  pthread_mutex_lock(&once_masterlock); *once_control = NEVER; pthread_mutex_unlock(&once_masterlock); pthread_cond_broadcast(&once_finished);
*kind = attr->__mutexkind; return 0;
weak_alias (__pthread_mutexattr_setpshared, pthread_mutexattr_setpshared)/* Once-only execution */static pthread_mutex_t once_masterlock = PTHREAD_MUTEX_INITIALIZER;static pthread_cond_t once_finished = PTHREAD_COND_INITIALIZER;static int fork_generation = 0;	/* Child process increments this after fork. */enum { NEVER = 0, IN_PROGRESS = 1, DONE = 2 };/* If a thread is canceled while calling the init_routine out of   pthread once, this handler will reset the once_control variable   to the NEVER state. */static void pthread_once_cancelhandler(void *arg){    pthread_once_t *once_control = arg;    pthread_mutex_lock(&once_masterlock);    *once_control = NEVER;    pthread_mutex_unlock(&once_masterlock);    pthread_cond_broadcast(&once_finished);}