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

Implements a light-weight reentrant binary lock. More...

#include <critical_section.h>

Inherits noncopyable.

List of all members.

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.

Detailed Description

Implements a light-weight reentrant binary lock.


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