Data.DBXPlatform.TDBXSemaphore
Delphi
TDBXSemaphore = class(TSemaphore)
C++
class PASCALIMPLEMENTATION TDBXSemaphore : public System::Syncobjs::TSemaphore
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
class | public | Data.DBXPlatform.pas Data.DBXPlatform.hpp |
Data.DBXPlatform | Data.DBXPlatform |
Description
Synchronization primitive that manages multiple parallel thread executions for sharing a common resource.
In dbExpress, TDBXSemaphore is a synchronization primitive that manages multiple parallel thread executions for sharing a common resource.
To each dbExpress semaphore there is an associated counter variable. This variable gives the shared resource's number of units that are currently free. The counter is decremented whenever a thread locks the semaphore and incremented when a thread releases the semaphore.
If a thread tries to lock the semaphore and the counter value is nil, then the thread adds to the semaphore waiting queue. The first thread in the semaphore queue locks the semaphore as soon as the counter value is nonzero.