ThreadNS::Lock Class Reference#include <Thread.h>
List of all members.
Detailed Description
an inter-thread lock -- doesn't work across processes, only threads within a process. (see MutexLock for inter-process locks)
Definition at line 17 of file Thread.h.
|
Public Member Functions |
| Lock () |
| constructor
|
| ~Lock () |
| destructor -- dereference and release (if any references remain)
|
void | lock () |
| block until lock is obtained
|
bool | trylock () |
| see if lock is available
|
void | unlock () |
| release lock, if held
|
unsigned int | getInstanceLockLevel () const |
| returns the lock level of the local instance of Lock (as opposed to the lock storage structure, which might be shared with other Lock instances)
|
unsigned int | getLockLevel () const |
| returns the lock level of the lock storage itself, the sum of all instance's lock levels
|
Protected Member Functions |
virtual void | useResource (Resource::Data &) |
| marks the resource as in use
|
virtual void | releaseResource (Resource::Data &) |
| releases the resource
|
Static Protected Member Functions |
static void | setup () |
| creates a new glock if it is currently NULL (should be called by the Lock() constructor)
|
Protected Attributes |
LockStorage * | mylock |
| This lock's implementation.
|
unsigned int | locklevel |
| the current lock level from this Lock, may differ from mylock's lock level if several Locks are sharing a storage!
|
Static Protected Attributes |
static LockStorage * | glock |
| this internal class will hold the system-dependent lock information
|
Private Member Functions |
| Lock (const Lock &l) |
| don't call
|
Lock & | operator= (const Lock &l) |
| don't call
|
Friends |
class | MarkScope |
class | Condition |
Constructor & Destructor Documentation
ThreadNS::Lock::~Lock |
( |
|
) |
|
destructor -- dereference and release (if any references remain)
Definition at line 457 of file Thread.cc.
ThreadNS::Lock::Lock |
( |
const Lock & |
l |
) |
[private] |
Member Function Documentation
void ThreadNS::Lock::lock |
( |
|
) |
|
bool ThreadNS::Lock::trylock |
( |
|
) |
|
see if lock is available
Definition at line 471 of file Thread.cc.
void ThreadNS::Lock::unlock |
( |
|
) |
|
unsigned int ThreadNS::Lock::getInstanceLockLevel |
( |
|
) |
const [inline] |
returns the lock level of the local instance of Lock (as opposed to the lock storage structure, which might be shared with other Lock instances)
Definition at line 27 of file Thread.h.
unsigned int ThreadNS::Lock::getLockLevel |
( |
|
) |
const |
returns the lock level of the lock storage itself, the sum of all instance's lock levels
Definition at line 483 of file Thread.cc.
virtual void ThreadNS::Lock::useResource |
( |
Resource::Data & |
d |
) |
[inline, protected, virtual] |
virtual void ThreadNS::Lock::releaseResource |
( |
Resource::Data & |
d |
) |
[inline, protected, virtual] |
void ThreadNS::Lock::setup |
( |
|
) |
[static, protected] |
creates a new glock if it is currently NULL (should be called by the Lock() constructor)
Definition at line 486 of file Thread.cc.
Referenced by Lock().
Lock& ThreadNS::Lock::operator= |
( |
const Lock & |
l |
) |
[private] |
Friends And Related Function Documentation
Member Data Documentation
this internal class will hold the system-dependent lock information
The global lock to protect Locks sharing mylock's
Definition at line 35 of file Thread.h.
Referenced by Lock(), setup(), and ~Lock().
The documentation for this class was generated from the following files:
|