UCommon
|
A kind of smart pointer object to support exclusive locking protocol. More...
#include <access.h>
Inherited by ucommon::autoexclusive< T > [private]
.
Public Member Functions | |
Locking (ExclusiveProtocol *object) | |
Create an instance of an exclusive object reference. More... | |
operator bool () const | |
Test if the reference holds an active lock. More... | |
bool | operator! () const |
Test if the reference holds an active lock. More... | |
void | release (void) |
Release a held lock programmatically. More... | |
~Locking () | |
Destroy reference to exclusively locked object, release lock. | |
A kind of smart pointer object to support exclusive locking protocol.
This object initiates an exclusive lock for the object being referenced when it is instantiated, and releases the exclusive lock when it is destroyed. You would pass the pointer an object that has the Exclusive as a base class.
ucommon::ExclusiveProtocol::Locking::Locking | ( | ExclusiveProtocol * | object | ) |
Create an instance of an exclusive object reference.
object | containing Exclusive base class protocol to lock. |
|
inline |
|
inline |
void ucommon::ExclusiveProtocol::Locking::release | ( | void | ) |
Release a held lock programmatically.
This can be used to de-reference the object being exclusively locked without having to wait for the destructor to be called when the exclusive_lock falls out of scope.