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

util::WriteLockHandle Class Reference

#include <AutoLock.h>

Inheritance diagram for util::WriteLockHandle:


List of all members.

Detailed Description

Write-only semaphore handle implementation.

This is an auxiliary base class for classes that need write-only (exclusive) locking and do not need read (shared) locking. This implementation uses a cheap and fast critical section for both lockWrite() and lockRead() methods which makes a lockRead() call fully equivalent to the lockWrite() call and therefore makes it pointless to use instahces of this class with AutoReadLock instances -- shared locking will not be possible anyway and any call to lock() will block if there are lock owners on other threads.

Use with care only when absolutely sure that shared locks are not necessary.

Definition at line 192 of file AutoLock.h.

Public Member Functions

virtual bool isWriteLockOnCurrentThread () const
virtual void lockRead (LOCKVAL_SRC_POS_DECL)
virtual void lockWrite (LOCKVAL_SRC_POS_DECL)
virtual void unlockRead ()
virtual void unlockWrite ()
 WriteLockHandle (VBoxLockingClass lockClass)
virtual uint32_t writeLockLevel () const

Private Attributes

Data * m


struct  Data

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

Generated by  Doxygen 1.6.0   Back to index