Contents Up Previous Next

wxCriticalSectionLocker

This is a small helper class to be used with wxCriticalSection objects. A wxCriticalSectionLocker enters the critical section in the constructor and leaves it in the destructor making it much more difficult to forget to leave a critical section (which, in general, will lead to serious and difficult to debug problems).

Derived from

None.

Include files

<wx/thread.h>

See also

wxCriticalSection, wxMutexLocker

Members

wxCriticalSectionLocker::wxCriticalSectionLocker
wxCriticalSectionLocker::~wxCriticalSectionLocker


wxCriticalSectionLocker::wxCriticalSectionLocker

wxCriticalSectionLocker(wxCriticalSection *criticalsection)

Constructs a wxCriticalSectionLocker object associated with given criticalsection which must be non NULL and enters it.


wxCriticalSectionLocker::~wxCriticalSectionLocker

~wxCriticalSectionLocker()

Destuctor leaves the criticalsection.