|
BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
|
Public Member Functions | |
| Semaphore (unsigned int resource_count=0) | |
| void | acquire () |
| Acquires a resource from the semaphore. | |
| void | release () |
| Releases a resource from the semaphore. | |
Private Attributes | |
| mutex | mutex_ |
| condition_variable | condition_ |
| unsigned int | count_ |
Definition at line 76 of file nica-scheduler.cpp.
|
inline |
Definition at line 79 of file nica-scheduler.cpp.
References count_.
|
inline |
Decrements the internal resource count. If the count is zero, the calling thread will block until another thread releases a resource by calling release().
Definition at line 90 of file nica-scheduler.cpp.
References condition_, count_, and mutex_.
|
inline |
Increments the internal resource count. If a thread is waiting for a resource to be released, it will be notified.
Definition at line 103 of file nica-scheduler.cpp.
References condition_, count_, and mutex_.
|
private |
Definition at line 112 of file nica-scheduler.cpp.
|
private |
Definition at line 113 of file nica-scheduler.cpp.
Referenced by Semaphore(), acquire(), and release().
|
private |
Definition at line 111 of file nica-scheduler.cpp.