rippled
|
Public Types | |
using | size_type = std::size_t |
Public Member Functions | |
basic_semaphore (size_type count=0) | |
Create the semaphore, with an optional initial count. More... | |
void | notify () |
Increment the count and unblock one waiting thread. More... | |
void | wait () |
Block until notify is called. More... | |
bool | try_wait () |
Perform a non-blocking wait. More... | |
Private Attributes | |
Mutex | m_mutex |
CondVar | m_cond |
std::size_t | m_count |
Definition at line 29 of file semaphore.h.
using ripple::basic_semaphore< Mutex, CondVar >::size_type = std::size_t |
Definition at line 37 of file semaphore.h.
|
explicit |
Create the semaphore, with an optional initial count.
If unspecified, the initial count is zero.
Definition at line 42 of file semaphore.h.
void ripple::basic_semaphore< Mutex, CondVar >::notify | ( | ) |
Increment the count and unblock one waiting thread.
Definition at line 48 of file semaphore.h.
void ripple::basic_semaphore< Mutex, CondVar >::wait | ( | ) |
Block until notify is called.
Definition at line 57 of file semaphore.h.
bool ripple::basic_semaphore< Mutex, CondVar >::try_wait | ( | ) |
Perform a non-blocking wait.
true
If the wait would be satisfied. Definition at line 69 of file semaphore.h.
|
private |
Definition at line 32 of file semaphore.h.
|
private |
Definition at line 33 of file semaphore.h.
|
private |
Definition at line 34 of file semaphore.h.