Go to the documentation of this file.
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);
A lightweight C++ object whose constructor calls acquire() and whose destructor calls release() on a ...
int get_count() const
Returns the current semaphore count.
void notify()
Informs one of the other threads who are currently blocked on wait() that the relevant condition has ...
void acquire()
Decrements the internal count.
int release()
Increments the semaphore's internal count.
bool try_acquire()
If the semaphore can be acquired without blocking, does so and returns true.
void wait()
Waits on the condition.