22 Semaphore(
int initial_count) :
23 _lock(
"Semaphore::_lock"),
27 nassertv(_count >= 0);
56 INLINE
void Semaphore::
70 TAU_PROFILE(
"void Semaphore::acquire()",
" ", TAU_USER);
72 nassertv(_count >= 0);
87 TAU_PROFILE(
"void Semaphore::acquire(bool)",
" ", TAU_USER);
89 nassertr(_count >= 0,
false);
107 TAU_PROFILE(
"void Semaphore::release()",
" ", TAU_USER);
123 TAU_PROFILE(
"void Semaphore::get_count()",
" ", TAU_USER);
int release()
Increments the semaphore's internal count.
A classic semaphore synchronization primitive.
A lightweight C++ object whose constructor calls acquire() and whose destructor calls release() on a ...
void acquire()
Decrements the internal count.
int get_count() const
Returns the current semaphore count.
bool try_acquire()
If the semaphore can be acquired without blocking, does so and returns true.
void wait()
Waits on the condition.
void notify()
Informs one of the other threads who are currently blocked on wait() that the relevant condition has ...