SyncObjs.TConditionVariableCS
Contents |
Delphi Information
From SyncObjs.pas
TConditionVariableCS = class(TSynchroObject)
Unit: SyncObjs
Type: class
Inherited Class Members: SyncObjs.TConditionVariableCS Members
Class Methods: SyncObjs.TConditionVariableCS Methods
Class Fields: SyncObjs.TConditionVariableCS Fields
Class Constructors & Destructors: SyncObjs.TConditionVariableCS Constructors
C++ Information
From SyncObjs.hpp
TConditionVariableCS = class(TSynchroObject)
Unit: SyncObjs
Type: class
Inherited Class Members: SyncObjs.TConditionVariableCS Members
Class Methods: SyncObjs.TConditionVariableCS Methods
Class Fields: SyncObjs.TConditionVariableCS Fields
Class Constructors & Destructors: SyncObjs.TConditionVariableCS Constructors
Description
TConditionVariableCS allows the use of condition variables in combination with critical sections.
Use TConditionVariableCS in multi-threaded applications in which a thread is required to sleep, inside its critical section, until a specified condition becomes true. During this waiting period, other threads are able to run and are supposed to notify the sleeping thread when the condition becomes true.
When the condition variable is awakened, the critical section is automatically reacquired.
To create a condition variable, instantiate the TConditionVariableCS class. Then, in the executing code of each thread, use a combination of WaitFor and the Release or ReleaseAll methods in order to achieve the communication between threads.