sysuthrd.inc 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2005 by the Free Pascal development team
  4. See the file COPYING.FPC, included in this distribution,
  5. for details about the copyright.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. **********************************************************************}
  10. constructor TMultiReadExclusiveWriteSynchronizer.Create;
  11. begin
  12. System.InitCriticalSection(Crit);
  13. end;
  14. destructor TMultiReadExclusiveWriteSynchronizer.Destroy;
  15. begin
  16. System.DoneCriticalSection(Crit);
  17. end;
  18. function TMultiReadExclusiveWriteSynchronizer.Beginwrite : boolean;
  19. begin
  20. System.EnterCriticalSection(Crit);
  21. result:=true;
  22. end;
  23. procedure TMultiReadExclusiveWriteSynchronizer.Endwrite;
  24. begin
  25. System.LeaveCriticalSection(Crit);
  26. end;
  27. procedure TMultiReadExclusiveWriteSynchronizer.Beginread;
  28. begin
  29. System.EnterCriticalSection(Crit);
  30. end;
  31. procedure TMultiReadExclusiveWriteSynchronizer.Endread;
  32. begin
  33. System.LeaveCriticalSection(Crit);
  34. end;