Lines Matching refs:Semaphore
14 #include <mach/semaphore.h> // NOLINT
16 #include <semaphore.h> // NOLINT
26 // Semaphore
28 // A semaphore object is a synchronization object that maintains a count. The
29 // count is decremented each time a thread completes a wait for the semaphore
30 // object and incremented each time a thread signals the semaphore. When the
31 // count reaches zero, threads waiting for the semaphore blocks until the
34 class Semaphore FINAL {
36 explicit Semaphore(int count);
37 ~Semaphore();
39 // Increments the semaphore counter.
42 // Suspends the calling thread until the semaphore counter is non zero
43 // and then decrements the semaphore counter.
48 // counter is unchanged. Otherwise the semaphore counter is decremented and
70 DISALLOW_COPY_AND_ASSIGN(Semaphore);
74 // POD Semaphore initialized lazily (i.e. the first time Pointer() is called).
76 // // The following semaphore starts at 0.
86 static Semaphore* Create() {
87 return new Semaphore(N);
93 typedef typename LazyDynamicInstance<Semaphore, CreateSemaphoreTrait<N>,