Threading::GaCriticalSection Class Reference

GaCriticalSection class is wrapper class for system synchronization object. More...

#include <D:/Temp/vs/gal/source/Threading.h>

List of all members.

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.


Detailed Description

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.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.


Member Data Documentation

System specific object used for synchronization of critical section.


The documentation for this class was generated from the following file:

Genetic Algorithm Library
Coolsoft Software Development