Mutual exclusion class.
Mutual exclusion class. Class GCriticalSection provides an efficient way to protect segment of codes (critical sections) which should not be simultaneously executed by two threads. Only one thread can own a critical section object at a given time. Function lock causes the current thread to own the critical section object (or wait as long as necessary). Function unlock is used to release the critical section object. Critical section in the code are easily protected by creating a critical section object, locking this object at beginning of the critical section code, and unlocking the object at the end of the critical section code. Class GCriticalSectionLock provides a convenient way to do this effectively.Note. Both the copy constructor and the copy operator are declared as private members. It is therefore not possible to make multiple copies of instances of this class, as implied by the class semantic.
void unlock()
Alphabetic index HTML hierarchy of classes or Java