Description | Hierarchy | Fields | Methods | Properties |
type unaAbstractGate = class(unaObject)
Abstract class for all gates (critical sections) objects.
f_isBusy: bool; |
constructor create(); |
|
function enter(timeout: tTimeout = tTimeout(INFINITE) ): bool; |
|
function gateEnter(timeout: tTimeout = tTimeout(INFINITE) ): bool; virtual; |
|
procedure leave(); |
|
procedure gateLeave(); virtual; |
property isBusy: bool read f_isBusy; |
f_isBusy: bool; |
|
constructor create(); |
|
function enter(timeout: tTimeout = tTimeout(INFINITE) ): bool; |
|
Enters the gate. timeout parameter specifies the amount of time (in milliseconds) attempt to enter the gate should last. Returns false if gate cannot be entered and timeout was expired. Returns true if gate was entered successfully. Default timeout value is INFINITE. That means routine should wait forever, until gate will be freed. Use this default value carefully, as it could lead to deadlocks in your application. |
function gateEnter(timeout: tTimeout = tTimeout(INFINITE) ): bool; virtual; |
|
procedure leave(); |
|
Every successful enter() must be followed by leave(). Do not call leave() unless enter() returns true. |
procedure gateLeave(); virtual; |
|
property isBusy: bool read f_isBusy; |
|
Indicates if gate is busy by one ore more threads. Do not use this property if you want to make sure gate is free. Use enter() instead. The only good use for this property is in some kind of visual indication to end-user whether the gate is free. |
(c) 2012 Lake of Soft