syncobh.inc 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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.1 2000-07-13 06:31:31 michael
  53. + Initial import
  54. Revision 1.4 2000/01/07 01:24:33 peter
  55. * updated copyright to 2000
  56. Revision 1.3 2000/01/06 01:20:33 peter
  57. * moved out of packages/ back to topdir
  58. Revision 1.1 2000/01/03 19:33:08 peter
  59. * moved to packages dir
  60. Revision 1.1 1999/06/07 15:52:46 michael
  61. + Renamed to syncobh
  62. Revision 1.2 1998/09/30 13:41:05 florian
  63. * fixes to make it compilable
  64. Revision 1.1 1998/09/29 11:14:25 florian
  65. + initial revision
  66. }