class TLockGuard


TVirtualMutex

This class implements a mutex interface. The actual work is done via
TMutex which is available as soon as the thread library is loaded.

and

TLockGuard

This class provides mutex resource management in a guaranteed and
exception safe way. Use like this:
{
TLockGuard guard(mutex);
... // do something
}
when guard goes out of scope the mutex is unlocked in the TLockGuard
destructor. The exception mechanism takes care of calling the dtors
of local objects so it is exception safe.


Function Members (Methods)

public:
TLockGuard(TVirtualMutex* mutex)
virtual~TLockGuard()
static TClass*Class()
virtual TClass*IsA() const
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
private:
TLockGuard(const TLockGuard&)
TLockGuard&operator=(const TLockGuard&)

Data Members

private:
TVirtualMutex*fMutex

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TLockGuard(const TLockGuard&)
TLockGuard& operator=(const TLockGuard& )
TLockGuard(TVirtualMutex *mutex)
{ if (fMutex) fMutex->Lock(); }
virtual ~TLockGuard()
{ if (fMutex) fMutex->UnLock(); }

Author: Fons Rademakers 14/07/2002
Last update: root/base:$Id: TVirtualMutex.h 20877 2007-11-19 11:17:07Z rdm $
Copyright (C) 1995-2002, Rene Brun and Fons Rademakers. *

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.