#include <CMutex.h> CriticalSection CriticalSection(CMutex& mutex);
CriticalSection
CriticalSection(CMutex& mutex);
Implements an easy to use critical section on top of a mutex. To use, simply construct the CriticalSection object in the block that needs synchronization. The constructor will lock the mutex and unlock it when destroyed (when the block is exited)
#include <CMutex.h> ... CMutex guard; ... { CriticalSection s(guard); // Locks guard ... throw someException; // unlocks guard. ... } // unlocks guard.