Lunchbox  1.4.0
Public Member Functions
lunchbox::Lock Class Reference

A lock (mutex) primitive. More...

#include <lock.h>

+ Inheritance diagram for lunchbox::Lock:
+ Collaboration diagram for lunchbox::Lock:

List of all members.

Public Member Functions

 Lock ()
 Construct a new lock.
 ~Lock ()
 Destruct the lock.
void set ()
 Acquire the lock.
void unset ()
 Release the lock.
void setRead ()
 Acquire the lock shared with other readers.
void unsetRead ()
 Release a shared read lock.
bool trySet ()
 Attempt to acquire the lock.
bool isSet ()
 Test if the lock is set.

Detailed Description

A lock (mutex) primitive.

See also:
ScopedMutex

Definition at line 32 of file lock.h.


Constructor & Destructor Documentation

Construct a new lock.

Version:
1.0

Destruct the lock.

Version:
1.0

Member Function Documentation

Test if the lock is set.

Returns:
true if the lock is set, false if it is not set.
Version:
1.0

Acquire the lock.

Version:
1.0
void lunchbox::Lock::setRead ( ) [inline]

Acquire the lock shared with other readers.

Version:
1.3.2

Definition at line 48 of file lock.h.

Attempt to acquire the lock.

This method implements an atomic test-and-set operation.

Returns:
true if the lock was set, false if it was not set.
Version:
1.0

Release the lock.

Version:
1.0

Referenced by unsetRead().

+ Here is the caller graph for this function:

void lunchbox::Lock::unsetRead ( ) [inline]

Release a shared read lock.

Version:
1.3.2

Definition at line 51 of file lock.h.

References unset().

+ Here is the call graph for this function:


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