Manages locking and unlocking of a mutes. More...
#include <ScopedSemaphore.h>
Public Member Functions | |
bool | isDecremented () const |
Check if the semaphore has been successfully decremented. More... | |
operator bool () const | |
Implicit conversion to bool. More... | |
ScopedSemaphore (Semaphore &semaphore) | |
Decrements the semaphore. More... | |
~ScopedSemaphore () | |
Increments the semaphore. More... | |
Private Attributes | |
bool | m_is_decremented |
Semaphore & | m_semaphore |
Additional Inherited Members | |
Protected Member Functions inherited from icl_core::Noncopyable | |
Noncopyable () | |
virtual | ~Noncopyable () |
Manages locking and unlocking of a mutes.
Locks or tries to lock a mutex in the constructor and unlocks it in the destructor.
Definition at line 50 of file ScopedSemaphore.h.
|
explicit |
Decrements the semaphore.
Definition at line 30 of file ScopedSemaphore.cpp.
icl_core::logging::ScopedSemaphore::~ScopedSemaphore | ( | ) |
Increments the semaphore.
Definition at line 40 of file ScopedSemaphore.cpp.
|
inline |
Check if the semaphore has been successfully decremented.
Definition at line 60 of file ScopedSemaphore.h.
|
inline |
Implicit conversion to bool.
Definition at line 63 of file ScopedSemaphore.h.
|
private |
Definition at line 78 of file ScopedSemaphore.h.
|
private |
Definition at line 77 of file ScopedSemaphore.h.