syncobh.inc 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. {
  2. $Id$
  3. This file is part of the Free Component Library (FCL)
  4. Copyright (c) 1999-2000 by Florian Klaempfl
  5. member of the Free Pascal development team
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. type
  13. TSyncroObject = class(TObject)
  14. procedure Acquire;virtual;abstract;
  15. procedure Release;virtual;abstract;
  16. end;
  17. TCriticalSection = class(TSyncroObject)
  18. {$ifdef win32}
  19. private
  20. CriticalSection : TRTLCriticalSection;
  21. {$endif win32}
  22. public
  23. procedure Acquire;override;
  24. procedure Release;override;
  25. procedure Enter;
  26. procedure Leave;
  27. constructor Create;
  28. destructor Destroy;override;
  29. end;
  30. THandleObject = class(TSyncroObject)
  31. protected
  32. FHandle : TEventHandle;
  33. FLastError : Integer;
  34. public
  35. destructor destroy;override;
  36. property Handle : TEventHandle read FHandle;
  37. property LastError : Integer read FLastError;
  38. end;
  39. TEventObject = class(THandleObject)
  40. public
  41. constructor Create(EventAttributes : PSecurityAttributes;
  42. ManualReset,InitialState : Boolean;const Name : string);
  43. procedure ResetEvent;
  44. procedure SetEvent;
  45. function WaitFor(Timeout : Cardinal) : TWaitResult;
  46. end;
  47. TSimpleEvent = class(TEventObject)
  48. constructor Create;
  49. end;
  50. {
  51. $Log$
  52. Revision 1.2 2000-07-13 11:33:01 michael
  53. + removed logs
  54. }