From ace5fc1f57ae974bab9387d34baaa6f78309e28f Mon Sep 17 00:00:00 2001 From: florian Date: Tue, 29 Sep 1998 11:14:25 +0000 Subject: [PATCH] + initial revision --- fcl/inc/syncobjs.inc | 35 +++++++++++++++++++++++ fcl/inc/syncobjsh.inc | 39 ++++++++++++++++++++++++++ fcl/win32/syncobjs.pp | 65 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 139 insertions(+) create mode 100644 fcl/inc/syncobjs.inc create mode 100644 fcl/inc/syncobjsh.inc create mode 100644 fcl/win32/syncobjs.pp diff --git a/fcl/inc/syncobjs.inc b/fcl/inc/syncobjs.inc new file mode 100644 index 0000000000..d8d807297c --- /dev/null +++ b/fcl/inc/syncobjs.inc @@ -0,0 +1,35 @@ +{ + $Id$ + This file is part of the Free Component Library (FCL) + Copyright (c) 1998 by Florian Klaempfl + member of the Free Pascal development team + + See the file COPYING.FPC, included in this distribution, + for details about the copyright. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + **********************************************************************} + +procedure TCriticalSection.Enter; + + begin + Acquire; + end; + +procedure TCriticalSection.Leave; + + begin + Release; + end; + +end. + +{ + $Log$ + Revision 1.1 1998-09-29 11:14:25 florian + + initial revision + +} diff --git a/fcl/inc/syncobjsh.inc b/fcl/inc/syncobjsh.inc new file mode 100644 index 0000000000..4496cd5b01 --- /dev/null +++ b/fcl/inc/syncobjsh.inc @@ -0,0 +1,39 @@ +{ + $Id$ + This file is part of the Free Component Library (FCL) + Copyright (c) 1998 by Florian Klaempfl + member of the Free Pascal development team + + See the file COPYING.FPC, included in this distribution, + for details about the copyright. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + **********************************************************************} + +type + TSyncroObject = class(TObject) + procedure Acquire;virtual;abstract; + procedure Release;virtual;abstract; + end; + + TCriticalSection = class(TSyncroObject) + private + CriticalSection : TRTLCriticalSection; + public + procedure Acquire;override; + procedure Release;override; + procedure Enter; + procedure Leave; + constructor Create; + destructor Destroy; + end; + +{ + $Log$ + Revision 1.1 1998-09-29 11:14:25 florian + + initial revision + +} diff --git a/fcl/win32/syncobjs.pp b/fcl/win32/syncobjs.pp new file mode 100644 index 0000000000..f81f584a89 --- /dev/null +++ b/fcl/win32/syncobjs.pp @@ -0,0 +1,65 @@ +{ + $Id$ + This file is part of the Free Component Library (FCL) + Copyright (c) 1998 by Florian Klaempfl + member of the Free Pascal development team + + See the file COPYING.FPC, included in this distribution, + for details about the copyright. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + **********************************************************************} + +unit syncobjs; + + interface + + uses + sysutils; + + {$syncobjsh.inc} + + implementation + + uses + windows; + + {$syncobjs.inc} + + procedure TCriticalSection.Acquire; + + begin + EnterCriticalSection(CriticalSection); + end; + + procedure TCriticalSection.Release; + + begin + LeaveCriticalSection(CriticalSection); + end; + + constructor TCriticalSection.Create; + + begin + inherited Create; + InitializeCriticalSection(CriticalSection); + end; + + destructor TCriticalSection.Destroy; + + begin + DeleteCriticalSection(CriticalSection); + inherited Destroy; + end; + +end. + +{ + $Log$ + Revision 1.1 1998-09-29 11:15:24 florian + + initial revision + +}