lean cpp library
A lean C++ library providing efficient utility classes for high-performance C++ applications.
|
Implements a semaphore. More...
#include <semaphore.h>
Inherits noncopyable.
Public Member Functions | |
semaphore (long initialCount=1) | |
Constructs a critical section. Throws a runtime_error on failure. | |
~semaphore () | |
Destructor. | |
LEAN_INLINE bool | try_lock () |
Tries to acquire this semaphore, returning false if currenty unavailable. | |
LEAN_INLINE void | lock () |
Acquires this semaphore, returning immediately on success, otherwise waiting for the semaphore to become available. | |
LEAN_INLINE void | unlock () |
Releases this semaphore, permitting waiting threads to continue execution. | |
LEAN_INLINE HANDLE | native_handle () const |
Gets the native handle. |
Implements a semaphore.