C12Adapter Opensource C++ Interface
MCriticalSection::Locker Class Reference

Class that helps dealing with critical sections within a single execution scope. More...

Public Member Functions

 Locker (const MCriticalSection &criticalSection)
 Create a critical section lock with the object given as parameter, and lock the given critical section for the exclusive usage. More...
 
 ~Locker ()
 Unlock the critical section and destroy the lock object. More...
 

Detailed Description

Class that helps dealing with critical sections within a single execution scope.

See also
MCriticalSection - critical section class to be used with this locker
example in class description for information on how to use it.

Constructor & Destructor Documentation

MCriticalSection::Locker::Locker ( const MCriticalSection criticalSection)
inline

Create a critical section lock with the object given as parameter, and lock the given critical section for the exclusive usage.

Parameters
criticalSectionCritical section object to lock from the given thread.
See also
example in class description for information on how to use it.
MCriticalSection::Locker::~Locker ( )
inline

Unlock the critical section and destroy the lock object.

Typically done automatically when the lock object goes out of scope.

See also
example in class description for information on how to use it.