Lines Matching defs:semaphore
26 // semaphore/STATE_SPINNING: Set by the second thread entering the function,
28 // that the thread manages to create a semaphore. This thread (and all
29 // following threads) will block on the semaphore until the first thread is
46 // If someone else is waiting, we need to delete the semaphore.
54 // someone is initializing -- we need to create a semaphore we can wait
56 sem_id semaphore = create_sem(0, "pthread once");
57 if (semaphore >= 0) {
59 value = atomic_test_and_set(control, semaphore, STATE_INITIALIZING);
61 value = semaphore;
63 delete_sem(semaphore);
65 // Failed to create the semaphore. Can only happen when the system
76 // wait on the semaphore