home *** CD-ROM | disk | FTP | other *** search
-
- {*******************************************************}
- { }
- { Borland Delphi Visual Component Library }
- { Win32 Synchronization objects }
- { }
- { Copyright (c) 1997,99 Inprise Corporation }
- { }
- {*******************************************************}
-
- unit SyncObjs;
-
- {$H+,X+}
-
- interface
-
- uses Sysutils, Windows, Messages, Classes;
-
- type
- TSynchroObject = class(TObject)
- public
- procedure Acquire; virtual;
- procedure Release; virtual;
- end;
-
- THandleObject = class(TSynchroObject)
- public
- destructor Destroy; override;
- property LastError: Integer;
- property Handle: THandle;
- end;
-
- TWaitResult = (wrSignaled, wrTimeout, wrAbandoned, wrError);
-
- TEvent = class(THandleObject)
- public
- constructor Create(EventAttributes: PSecurityAttributes; ManualReset,
- InitialState: Boolean; const Name: string);
- function WaitFor(Timeout: DWORD): TWaitResult;
- procedure SetEvent;
- procedure ResetEvent;
- end;
-
- TSimpleEvent = class(TEvent)
- public
- constructor Create;
- end;
-
- TCriticalSection = class(TSynchroObject)
- public
- constructor Create;
- destructor Destroy; override;
- procedure Acquire; override;
- procedure Release; override;
- procedure Enter;
- procedure Leave;
- end;
-
- implementation
-