CCritSec class

The CCritSec class provides a thread lock.

This class is a thin wrapper for a Windows CRITICAL_SECTION object. You can lock and unlock the thread by calling the CCritSec::Lock and CCritSec::Unlock methods. However, it is safer to use this class in conjunction with the CAutoLock class. When the CAutoLock class goes out of scope, it automatically unlocks the CCritSec object. Moreover, it compiles to efficient inline code.

Public Member Variables Description
m_currentOwner Thread identifier of the owning thread.
m_lockCount Number of outstanding locks on this object.
m_fTrace Boolean value that specifies whether to trace this lock.
Public MethodsDescription
CCritSec Constructor method.
~CCritSec Destructor method.
Lock Locks the critical section object.
Unlock Unlocks the critical section object.




Wxutil.h (include Streams.h)


Strmbase.lib (retail builds);
Strmbasd.lib (debug builds)

See also

Critical Section Objects
DirectShow Base Class Reference