home *** CD-ROM | disk | FTP | other *** search
/ PC World Plus! (NZ) 2001 June / HDC50.iso / Runimage / Delphi50 / Doc / SYNCOBJS.INT < prev    next >
Text File  |  1999-08-11  |  2KB  |  60 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Borland Delphi Visual Component Library         }
  5. {       Win32 Synchronization objects                   }
  6. {                                                       }
  7. {       Copyright (c) 1997,99 Inprise Corporation       }
  8. {                                                       }
  9. {*******************************************************}
  10.  
  11. unit SyncObjs;
  12.  
  13. {$H+,X+}
  14.  
  15. interface
  16.  
  17. uses Sysutils, Windows, Messages, Classes;
  18.  
  19. type
  20.   TSynchroObject = class(TObject)
  21.   public
  22.     procedure Acquire; virtual;
  23.     procedure Release; virtual;
  24.   end;
  25.  
  26.   THandleObject = class(TSynchroObject)
  27.   public
  28.     destructor Destroy; override;
  29.     property LastError: Integer;
  30.     property Handle: THandle;
  31.   end;
  32.  
  33.   TWaitResult = (wrSignaled, wrTimeout, wrAbandoned, wrError);
  34.  
  35.   TEvent = class(THandleObject)
  36.   public
  37.     constructor Create(EventAttributes: PSecurityAttributes; ManualReset,
  38.       InitialState: Boolean; const Name: string);
  39.     function WaitFor(Timeout: DWORD): TWaitResult;
  40.     procedure SetEvent;
  41.     procedure ResetEvent;
  42.   end;
  43.  
  44.   TSimpleEvent = class(TEvent)
  45.   public
  46.     constructor Create;
  47.   end;
  48.  
  49.   TCriticalSection = class(TSynchroObject)
  50.   public
  51.     constructor Create;
  52.     destructor Destroy; override;
  53.     procedure Acquire; override;
  54.     procedure Release; override;
  55.     procedure Enter;
  56.     procedure Leave;
  57.   end;
  58.  
  59. implementation
  60.