diff options
author | Jose Ruiz <ruiz@adacore.com> | 2005-06-16 10:28:24 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2005-06-16 10:28:24 +0200 |
commit | b497b46043b4679353aecf4be76266686813bdf3 (patch) | |
tree | 4fb352539eb2da55b0cd66a4286daa9a48c396d2 /gcc/ada/a-sytaco.ads | |
parent | 3084fecdb96ba949ce9188b6356121c911cdff76 (diff) | |
download | gcc-b497b46043b4679353aecf4be76266686813bdf3.tar.gz |
a-sytaco.ads, [...] (Suspension_Object): These objects are no longer protected objects.
2005-06-14 Jose Ruiz <ruiz@adacore.com>
Arnaud Charlet <charlet@adacore.com>
* a-sytaco.ads, a-sytaco.adb (Suspension_Object): These objects are no
longer protected objects. They have been replaced by lower-level
suspension objects made up by a mutex and a condition variable (or
their equivalent given a particular OS) plus some internal data to
reflect the state of the suspension object.
(Initialize, Finalize): Add this initialization procedure for
Suspension_Object, which is a controlled type.
(Finalize): Add the finalization procedure for Suspension_Object,
which is a controlled type.
* a-sytaco-vxworks.ads, a-sytaco-vxworks.adb: Remove this version of
Ada.Synchronous_Task_Control because there is no longer a need for a
VxWorks specific version of this package. Target dependencies
has been moved to System.Task_Primitives.Operations.
* s-osinte-mingw.ads (pCRITICAL_SECTION): Remove this type which is no
longer needed.
(InitializeCriticalSection, EnterCriticalSection,
LeaveCriticalSection, DeleteCriticalSection): Replace the type
pCriticalSection by an anonymous access type so that we avoid problems
of accessibility to local objects.
* s-taprop.ads, s-taprop-posix.adb, s-taprop-vxworks.adb,
s-taprop-mingw.adb, s-taprop-vms.adb, s-taprop-solaris.adb,
s-taprop-os2.adb, s-taprop-dummy.adb, s-taprop-hpux-dce.adb,
s-taprop-linux.adb, s-taprop-irix.adb, s-taprop-irix-athread.adb,
s-taprop-tru64.adb, s-taprop-lynxos.adb (Elaboration Code): No longer
set the environment task mask here.
(Current_State): Add this function that returns the state of the
suspension object.
(Set_False): Add this procedure that sets the state of the suspension
object to False.
(Set_True): Add this procedure that sets the state of the suspension
object to True, releasing the task that was suspended, if any.
(Suspend_Until_True): Add this procedure that blocks the calling task
until the state of the object is True. Program_Error is raised if
another task is already waiting on that suspension object.
(Initialize): Add this procedure for initializing the suspension
object. It initializes the mutex and the condition variable which are
used for synchronization and queuing, and it sets the internal state
to False.
(Finalize): Add this procedure for finalizing the suspension object,
destroying the mutex and the condition variable.
* s-taspri-posix.ads, s-taspri-vxworks.ads, s-taspri-mingw.ads,
s-taspri-vms.ads, s-taspri-solaris.ads, s-taspri-os2.ads,
s-taspri-dummy.ads, s-taspri-hpux-dce.ads, s-taspri-linux.ads,
s-taspri-tru64.ads, s-taspri-lynxos.ads (Suspension_Object): New object
which provides a low-level abstraction (using operating system
primitives) for Ada.Synchronous_Task_Control.
This object is made up by a mutex (for ensuring mutual exclusion), a
condition variable (for queuing threads until the condition is
signaled), a Boolean (State) indicating whether the object is open,
and a Boolean (Waiting) reflecting whether there is a task already
suspended on this object.
* s-intman.ads, s-intman-irix.adb, s-intman-irix-athread.adb,
s-intman-dummy.adb, s-intman-solaris.adb, s-intman-vms.adb,
s-intman-vms.ads, s-intman-mingw.adb,
(Initialize_Interrupts): Removed, no longer used.
* s-inmaop-posix.adb, s-inmaop-vms.adb, s-inmaop-dummy.adb,
(Setup_Interrupt_Mask): New procedure.
* s-intman-vxworks.ads, s-intman-vxworks.adb: Update comments.
* s-inmaop.ads (Setup_Interrupt_Mask): New procedure
* s-interr.adb: Add explicit call to Setup_Interrupt_Mask now that
this is no longer done in the body of s-taprop
(Server_Task): Explicitely test for Pending_Action in case
System.Parameters.No_Abort is True.
* s-taasde.adb: Add explicit call to Setup_Interrupt_Mask now that this
is no longer done in the body of s-taprop
From-SVN: r101015
Diffstat (limited to 'gcc/ada/a-sytaco.ads')
-rw-r--r-- | gcc/ada/a-sytaco.ads | 47 |
1 files changed, 33 insertions, 14 deletions
diff --git a/gcc/ada/a-sytaco.ads b/gcc/ada/a-sytaco.ads index b3a6a480a65..98eda726b9a 100644 --- a/gcc/ada/a-sytaco.ads +++ b/gcc/ada/a-sytaco.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-1998 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- @@ -35,9 +35,22 @@ -- -- ------------------------------------------------------------------------------ -with System; +pragma Warnings (Off); +-- Allow withing of non-Preelaborated units in Ada 2005 mode where this +-- package will be implicitly categorized as Preelaborate. See AI-362 for +-- details. It is safe in the context of the run-time to violate the rules! + +with System.Task_Primitives; +-- Used for Suspension_Object + +with Ada.Finalization; +-- Used for Limited_Controlled + +pragma Warnings (On); package Ada.Synchronous_Task_Control is +pragma Preelaborate_05 (Synchronous_Task_Control); +-- In accordance with Ada 2005 AI-362 type Suspension_Object is limited private; @@ -51,19 +64,25 @@ package Ada.Synchronous_Task_Control is private - -- ??? Using a protected object is overkill; suspension could be - -- implemented more efficiently. + procedure Initialize (S : in out Suspension_Object); + -- Initialization for Suspension_Object + + procedure Finalize (S : in out Suspension_Object); + -- Finalization for Suspension_Object - protected type Suspension_Object is - entry Wait; - procedure Set_False; - procedure Set_True; - function Get_Open return Boolean; - entry Wait_Exception; + type Suspension_Object is + new Ada.Finalization.Limited_Controlled with record + SO : System.Task_Primitives.Suspension_Object; + -- Use low-level suspension objects so that the synchronization + -- functionality provided by this object can be achieved using + -- efficient operating system primitives. + end record; - pragma Priority (System.Any_Priority'Last); - private - Open : Boolean := False; - end Suspension_Object; + pragma Inline (Set_True); + pragma Inline (Set_False); + pragma Inline (Current_State); + pragma Inline (Suspend_Until_True); + pragma Inline (Initialize); + pragma Inline (Finalize); end Ada.Synchronous_Task_Control; |