home *** CD-ROM | disk | FTP | other *** search
- ------------------------------------------------------------------------------
- -- --
- -- GNAT RUNTIME COMPONENTS --
- -- --
- -- A D A . S Y N C H R O N O U S _ T A S K _ C O N T R O L --
- -- --
- -- B o d y --
- -- --
- -- $Revision: 1.3 $ --
- -- --
- -- Copyright (c) 1992,1993,1994,1995 NYU, All Rights Reserved --
- -- --
- -- The GNAT library is free software; you can redistribute it and/or modify --
- -- it under terms of the GNU Library General Public License as published by --
- -- the Free Software Foundation; either version 2, or (at your option) any --
- -- later version. The GNAT library 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. See the GNU --
- -- Library General Public License for more details. You should have --
- -- received a copy of the GNU Library General Public License along with --
- -- the GNAT library; see the file COPYING.LIB. If not, write to the Free --
- -- Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. --
- -- --
- ------------------------------------------------------------------------------
-
-
- package body Ada.Synchronous_Task_Control is
-
- -------------------
- -- Suspension_PO --
- -------------------
-
- protected body Suspension_PO is
-
- ----------
- -- Wait --
- ----------
-
- entry Wait when Open is
- begin
- null;
- end Wait;
-
- ---------------
- -- Set_False --
- ---------------
-
- procedure Set_False is
- begin
- Open := False;
- end Set_False;
-
- --------------
- -- Set_True --
- --------------
-
- procedure Set_True is
- begin
- Open := True;
- end Set_True;
-
- --------------
- -- Get_Open --
- --------------
-
- function Get_Open return Boolean is
- begin
- return Open;
- end Get_Open;
-
- end Suspension_PO;
-
- --------------
- -- Set_True --
- --------------
-
- procedure Set_True (S : in out Suspension_Object) is
- begin
- S.Suspend.Set_True;
- end Set_True;
-
- ---------------
- -- Set_False --
- ---------------
-
- procedure Set_False (S : in out Suspension_Object) is
- begin
- S.Suspend.Set_False;
- end Set_False;
-
- -------------------
- -- Current_State --
- -------------------
-
- function Current_State (S : Suspension_Object) return Boolean is
- begin
- return S.Suspend.Get_Open;
- end Current_State;
-
- ------------------------
- -- Suspend_Until_True --
- ------------------------
-
- procedure Suspend_Until_True (S : in out Suspension_Object) is
- begin
- S.Suspend.Wait;
- end Suspend_Until_True;
-
-
- end Ada.Synchronous_Task_Control;
-