System.SyncObjs.TConditionVariableMutex

From Appmethod Libraries
Jump to: navigation, search

System.SyncObjs.TSynchroObjectSystem.TObjectTConditionVariableMutex

Object Pascal

TConditionVariableMutex = class(TSynchroObject)

C++

class PASCALIMPLEMENTATION TConditionVariableMutex : public TSynchroObject

Properties

Type Visibility Source Unit Parent
class public
System.SyncObjs.pas
System.SyncObjs.hpp
System.SyncObjs System.SyncObjs

Description

TConditionVariableMutex allows the use of condition variables in combination with mutexes.

Use TConditionVariableMutex in multi-threaded applications in which a thread is required to release a mutex 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 mutex is automatically reacquired.

To create a condition variable, simply instantiate the TConditionVariableMutex 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.

See Also