Logo Search packages:      
Sourcecode: virtualbox-ose version File versions  Download package

util::AutoWriteLock Class Reference

#include <AutoLock.h>

Inheritance diagram for util::AutoWriteLock:

util::AutoWriteLockBase util::AutoLockBase

List of all members.

Detailed Description

Automatic write lock. Use this with a RWLockHandle to request a read/write semaphore in write mode. There can only ever be one writer of a read/write semaphore: while the lock is held in write mode, no other writer or reader can request the semaphore and will block.

If constructed with a RWLockHandle or an instance of Lockable (which in practice means any VirtualBoxBase derivative), it autoamtically requests the lock in write mode and releases the write lock in the destructor.

When used with a WriteLockHandle, it requests the semaphore contained therein exclusively.

Definition at line 452 of file AutoLock.h.

Public Member Functions

void acquire ()
void attach (const Lockable *aLockable)
void attach (const Lockable &aLockable)
void attach (LockHandle &aHandle)
void attach (LockHandle *aHandle)
 AutoWriteLock (const Lockable *aLockable COMMA_LOCKVAL_SRC_POS_DECL)
 AutoWriteLock (const Lockable &aLockable COMMA_LOCKVAL_SRC_POS_DECL)
 AutoWriteLock (LockHandle &aHandle COMMA_LOCKVAL_SRC_POS_DECL)
 AutoWriteLock (LockHandle *aHandle COMMA_LOCKVAL_SRC_POS_DECL)
void enter ()
bool isWriteLockOnCurrentThread () const
void leave ()
void release ()
uint32_t writeLockLevel () const
virtual ~AutoWriteLock ()

Protected Member Functions

virtual void callLockImpl (LockHandle &l)
void callLockOnAllHandles ()
virtual void callUnlockImpl (LockHandle &l)
void callUnlockOnAllHandles ()
void cleanup ()

Protected Attributes

Data * m

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

Generated by  Doxygen 1.6.0   Back to index