Lines Matching defs:once_control
364 glthread_once_singlethreaded (pthread_once_t *once_control)
368 char *firstbyte = (char *)once_control;
371 /* First time use of once_control. Invert the first byte. */
404 glthread_once_singlethreaded (pth_once_t *once_control)
407 if (*once_control == PTH_ONCE_INIT)
409 /* First time use of once_control. Invert the marker. */
410 *once_control = ~ PTH_ONCE_INIT;
481 glthread_once (gl_once_t *once_control, void (*initfunction) (void))
483 if (!once_control->inited)
487 if (mutex_lock (&once_control->mutex) != 0)
489 if (!once_control->inited)
491 once_control->inited = 1;
494 if (mutex_unlock (&once_control->mutex) != 0)
500 glthread_once_singlethreaded (gl_once_t *once_control)
503 if (!once_control->inited)
505 /* First time use of once_control. Invert the marker. */
506 once_control->inited = ~ 0;
883 glthread_once (gl_once_t *once_control, void (*initfunction) (void))
885 if (once_control->inited <= 0)
887 if (InterlockedIncrement (&once_control->started) == 0)
889 /* This thread is the first one to come to this once_control. */
890 InitializeCriticalSection (&once_control->lock);
891 EnterCriticalSection (&once_control->lock);
892 once_control->inited = 0;
894 once_control->inited = 1;
895 LeaveCriticalSection (&once_control->lock);
900 InterlockedDecrement (&once_control->started);
904 while (once_control->inited < 0)
906 if (once_control->inited <= 0)
910 EnterCriticalSection (&once_control->lock);
911 LeaveCriticalSection (&once_control->lock);
912 if (!(once_control->inited > 0))