Lines Matching defs:semaphore
40 // If someone has set a semaphore, delete it.
57 // semaphore/STATE_SPINNING: Set by the second thread entering the function,
59 // that the thread manages to create a semaphore. This thread (and all
60 // following threads) will block on the semaphore until the first thread is
81 // If someone else is waiting, we need to delete the semaphore.
89 // someone is initializing -- we need to create a semaphore we can
91 sem_id semaphore = create_sem(0, "pthread once");
92 if (semaphore >= 0) {
95 semaphore, STATE_INITIALIZING);
97 value = semaphore;
99 delete_sem(semaphore);
101 // Failed to create the semaphore. Can only happen when the
112 // wait on the semaphore