lean cpp library
A lean C++ library providing efficient utility classes for high-performance C++ applications.
Public Member Functions
lean::concurrent::semaphore Class Reference

Implements a semaphore. More...

#include <semaphore.h>

Inherits noncopyable.

List of all members.

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.

Detailed Description

Implements a semaphore.


The documentation for this class was generated from the following file: