Lines Matching full:once_control
457 glthread_once_singlethreaded (pthread_once_t *once_control)
461 char *firstbyte = (char *)once_control;
464 /* First time use of once_control. Invert the first byte. */
497 glthread_once_multithreaded (pth_once_t *once_control, void (*initfunction) (void))
500 return (!pth_once (once_control, glthread_once_call, &temp) ? errno : 0);
504 glthread_once_singlethreaded (pth_once_t *once_control)
507 if (*once_control == PTH_ONCE_INIT)
509 /* First time use of once_control. Invert the marker. */
510 *once_control = ~ PTH_ONCE_INIT;
592 glthread_once_multithreaded (gl_once_t *once_control, void (*initfunction) (void))
594 if (!once_control->inited)
600 err = mutex_lock (&once_control->mutex);
603 if (!once_control->inited)
605 once_control->inited = 1;
608 return mutex_unlock (&once_control->mutex);
615 glthread_once_singlethreaded (gl_once_t *once_control)
618 if (!once_control->inited)
620 /* First time use of once_control. Invert the marker. */
621 once_control->inited = ~ 0;
1019 glthread_once_func (gl_once_t *once_control, void (*initfunction) (void))
1021 if (once_control->inited <= 0)
1023 if (InterlockedIncrement (&once_control->started) == 0)
1025 /* This thread is the first one to come to this once_control. */
1026 InitializeCriticalSection (&once_control->lock);
1027 EnterCriticalSection (&once_control->lock);
1028 once_control->inited = 0;
1030 once_control->inited = 1;
1031 LeaveCriticalSection (&once_control->lock);
1036 InterlockedDecrement (&once_control->started);
1040 while (once_control->inited < 0)
1042 if (once_control->inited <= 0)
1046 EnterCriticalSection (&once_control->lock);
1047 LeaveCriticalSection (&once_control->lock);
1048 if (!(once_control->inited > 0))