syncobh.inc 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. TWaitResult = (wrSignaled, wrTimeout, wrAbandoned, wrError);
  14. TSyncroObject = class(TObject)
  15. procedure Acquire;virtual;abstract;
  16. procedure Release;virtual;abstract;
  17. end;
  18. TCriticalSection = class(TSyncroObject)
  19. {$ifdef win32}
  20. private
  21. CriticalSection : TRTLCriticalSection;
  22. {$endif win32}
  23. public
  24. procedure Acquire;override;
  25. procedure Release;override;
  26. procedure Enter;
  27. procedure Leave;
  28. constructor Create;
  29. destructor Destroy;override;
  30. end;
  31. THandleObject = class(TSyncroObject)
  32. protected
  33. FHandle : TEventHandle;
  34. FLastError : Integer;
  35. public
  36. destructor destroy;override;
  37. property Handle : TEventHandle read FHandle;
  38. property LastError : Integer read FLastError;
  39. end;
  40. TEventObject = class(THandleObject)
  41. public
  42. constructor Create(EventAttributes : PSecurityAttributes;
  43. ManualReset,InitialState : Boolean;const Name : string);
  44. procedure ResetEvent;
  45. procedure SetEvent;
  46. function WaitFor(Timeout : Cardinal) : TWaitResult;
  47. end;
  48. TSimpleEvent = class(TEventObject)
  49. constructor Create;
  50. end;
  51. {
  52. $Log$
  53. Revision 1.4 2002-09-07 15:15:26 peter
  54. * old logs removed and tabs fixed
  55. }