18 Semaphore(
int initial_count) :
19 _lock(
"Semaphore::_lock"),
23 nassertv(_count >= 0);
32 TAU_PROFILE(
"void Semaphore::acquire()",
" ", TAU_USER);
34 nassertv(_count >= 0);
47 TAU_PROFILE(
"void Semaphore::acquire(bool)",
" ", TAU_USER);
49 nassertr(_count >= 0,
false);
65 TAU_PROFILE(
"void Semaphore::release()",
" ", TAU_USER);
78 TAU_PROFILE(
"void Semaphore::get_count()",
" ", TAU_USER);
int release()
Increments the semaphore's internal count.
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 ...