|
rippled
|
#include <semaphore.h>

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. | |
| void | notify () |
| Increment the count and unblock one waiting thread. | |
| void | wait () |
| Block until notify is called. | |
| bool | try_wait () |
| Perform a non-blocking wait. | |
Private Attributes | |
| Mutex | m_mutex |
| CondVar | m_cond |
| std::size_t | m_count |
Definition at line 38 of file semaphore.h.
| using ripple::basic_semaphore< Mutex, CondVar >::size_type = std::size_t |
Definition at line 46 of file semaphore.h.
|
explicit |
Create the semaphore, with an optional initial count.
If unspecified, the initial count is zero.
Definition at line 51 of file semaphore.h.
| void ripple::basic_semaphore< Mutex, CondVar >::notify | ( | ) |
Increment the count and unblock one waiting thread.
Definition at line 57 of file semaphore.h.
| void ripple::basic_semaphore< Mutex, CondVar >::wait | ( | ) |
Block until notify is called.
Definition at line 66 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 78 of file semaphore.h.
|
private |
Definition at line 41 of file semaphore.h.
|
private |
Definition at line 42 of file semaphore.h.
|
private |
Definition at line 43 of file semaphore.h.