Home Units Hierarchy Routines All identifiers

Class unaAbstractGate

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type unaAbstractGate = class(unaObject)

Description

Abstract class for all gates (critical sections) objects.

Hierarchy

Overview

Fields

Protected f_isBusy: bool;

Methods

Public constructor create();
Public function enter(timeout: tTimeout = tTimeout(INFINITE) ): bool;
Protected function gateEnter(timeout: tTimeout = tTimeout(INFINITE) ): bool; virtual;
Public procedure leave();
Protected procedure gateLeave(); virtual;

Properties

Public property isBusy: bool read f_isBusy;

Description

Fields

Protected f_isBusy: bool;
 

Methods

Public constructor create();
 
Public 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.

Protected function gateEnter(timeout: tTimeout = tTimeout(INFINITE) ): bool; virtual;
 
Public procedure leave();

Every successful enter() must be followed by leave(). Do not call leave() unless enter() returns true.

Protected procedure gateLeave(); virtual;
 

Properties

Public 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


Generated by PasDoc 0.12.1 on 2012-10-09