lean cpp library
A lean C++ library providing efficient utility classes for high-performance C++ applications.
|
Implements a light-weight reentrant binary lock. More...
#include <critical_section.h>
Inherits noncopyable.
Public Member Functions | |
critical_section (unsigned long spinCount=4096) | |
Constructs a critical section. Throws a runtime_error on failure. | |
~critical_section () | |
Destructor. | |
LEAN_INLINE bool | try_lock () |
Tries to lock this critical section, returning false if currenty locked by another user. | |
LEAN_INLINE void | lock () |
Locks this critical section, returning immediately on success, otherwise waiting for the section to become unlocked. | |
LEAN_INLINE void | unlock () |
Unlocks this critical section, permitting waiting threads to continue execution. |
Implements a light-weight reentrant binary lock.