GaCriticalSection
class is wrapper class for system synchronization object.
More...
#include <D:/Temp/vs/gal/source/Threading.h>
Public Member Functions | |
GaCriticalSection () | |
Constructor performs system specific initialization of synchronization object if needed. | |
~GaCriticalSection () | |
Frees resources used by system synchronization object. | |
void GACALL | Lock () |
Lock method acquires synchronization object and prevents other thread to access protected section simultaneously. If another thread had already acquired synchronization object current thread is put to sleep, and is waked when synchronization object is released. | |
void GACALL | Unlock () |
Unlock method release synchronization object and wakes threads which was put to wait for release of the object. | |
Private Attributes | |
SysSyncObject | _section |
System specific object used for synchronization of critical section. |
GaCriticalSection
class is wrapper class for system synchronization object.
This class provides basic synchronization and protection from concurrent access to the objects and resources. Built-in synchronizators used in other classes are instances of GaCriticalSection
class. LOCK
and UNLOCK
macros can operate on instances of this class.
Threading::GaCriticalSection::GaCriticalSection | ( | ) | [inline] |
Constructor performs system specific initialization of synchronization object if needed.
Threading::GaCriticalSection::~GaCriticalSection | ( | ) | [inline] |
Frees resources used by system synchronization object.
void GACALL Threading::GaCriticalSection::Lock | ( | ) | [inline] |
Lock
method acquires synchronization object and prevents other thread to access protected section simultaneously. If another thread had already acquired synchronization object current thread is put to sleep, and is waked when synchronization object is released.
void GACALL Threading::GaCriticalSection::Unlock | ( | ) | [inline] |
Unlock
method release synchronization object and wakes threads which was put to wait for release of the object.
System specific object used for synchronization of critical section.