TWaitableQueue

A queue that can be waited on

Inheritance

LevelAncestorDescription
1TObjectUltimate ancestor in a class hierarchy
2TWaitableObjectAhstract base class for an object that can be waited for using WaitFor
3TWaitableQueue

Source

Thread.Synchronization.WaitableQueue.pas (34)

Description

A TWaitableQueue can be used by multiple threads to safely Queue elements at the end of the queue and Dequeue from the front of the queue. Use WaitFor to postpone execution until the queue is not empty and a call to Dequeue will succeed. The queue can either have a finite maximum size or not. When there is a maximum size every call to Queue will block when the queue is full until a element is dequeued.

Fields

ScopeVisibilityTypeNameDescription
InstanceprotectedTThreadLockLock
InstanceprotectedTList<TElement>Elements
InstanceprotectedTSemaphoreEmptySemaphore
InstanceprotectedTSemaphoreSemaphore

Methods

ScopeVisibilityResultNameDescription
InstanceprivateTReferenceManager<TElement>GetElementManager()
InstanceprivateSetElementManager(Value: TReferenceManager<TElement>)
InstancepublicCreate(MaximumSize: TInteger32)
InstancepublicDestroy()
InstancepublicTHandleGetWaitHandle()
InstancepublicTInteger32Queue(Element: TElement)
InstancepublicTElementDequeue(Release: TBoolean)