aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/s-tasuti.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2007-06-06 12:14:59 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2007-06-06 12:14:59 +0200
commitdae22b53397e8fd26c4f059e25f1664a909eb7d3 (patch)
tree033a7e7bb81d1b4e3f0b917dd2668339fdc676b0 /gcc/ada/s-tasuti.adb
parent984d7dd399e6f4c29e73dee445ef149e70245459 (diff)
downloadgcc-dae22b53397e8fd26c4f059e25f1664a909eb7d3.zip
gcc-dae22b53397e8fd26c4f059e25f1664a909eb7d3.tar.gz
gcc-dae22b53397e8fd26c4f059e25f1664a909eb7d3.tar.bz2
s-taprop-vms.adb, [...] (Timed_Delay, [...]): Register the base time when entering this routine to detect a backward clock...
2007-04-20 Arnaud Charlet <charlet@adacore.com> * s-taprop-vms.adb, s-taprop-hpux-dce.adb, s-taprop-vxworks.adb, s-osprim-posix.adb, s-taprop-posix.adb, s-osprim-vxworks.adb, s-taprop-solaris.adb, s-osprim-solaris.adb, s-taprop-dummy.adb, s-osprim-unix.adb, s-osinte-freebsd.adb, s-osinte-freebsd.ads, s-osinte-lynxos.adb, s-osinte-lynxos.ads, s-taprop-tru64.adb, s-taprop-lynxos.adb, s-taprop-irix.adb, s-osinte-tru64.adb, s-osinte-tru64.ads, s-taprop-linux.adb, s-parame.ads, s-parame-vms-alpha.ads, s-parame-vms-ia64.ads, s-parame-hpux.ads, s-parame-vms-restrict.ads, s-parame-ae653.ads, s-parame-vxworks.ads, s-taprop-mingw.adb, s-osinte-lynxos-3.ads, s-osinte-lynxos-3.adb, s-osprim-mingw.adb (Timed_Delay, Timed_Sleep): Register the base time when entering this routine to detect a backward clock setting (manual setting or DST adjustment), to avoid waiting for a longer delay than needed. (Time_Duration, To_Timeval, struct_timeval): Removed when not relevant. Remove handling of deferred priority change, and replace by setting the task priority directly, as required by AI-188. Update comments. (Max_Task_Image_Length): New constant. Replace Warnings (Off) by Unreferenced pragma, cleaner. (Dynamic_Priority_Support): Removed, no longer needed. (Poll_Base_Priority_Change): Ditto. (Set_Ceiling): Add this procedure to change the ceiling priority associated to a lock. This is a dummy implementation because dynamic priority ceilings are not supported by the underlying system. * a-dynpri.adb (Set_Priority): Take into account case where Target is accepting a RV with its priority boosted. Remove handling of deferred priority change, and replace by setting the task priority directly, as required by AI-188. * s-taenca.adb (Try_To_Cancel_Entry_Call): Remove special case for Succeeded = True. Remove handling of deferred priority change, and replace by setting the task priority directly, as required by AI-188. (Wait_For_Completion, Wait_For_Call, Timed_Selective_Wait): Change state of Self_Id earlier. * s-tasini.ads, s-tasini.adb (Wakeup_Entry_Caller): Relax assertion. (Poll_Base_Priority_Change): Removed. Code clean up: use SSL.Current_Target_Exception. * s-tasren.adb (Task_Count): Call Yield to let a chance to other tasks to run as this is a potentially dispatching point. (Call_Synchronous): Use Local_Defer_Abort. (Callable): Relax assertion. (Selective_Wait): Relax assertion in case abort is not allowed. Remove handling of deferred priority change, and replace by setting the task priority directly, as required by AI-188. * s-tasuti.adb (Make_Passive): Adjust assertions. Remove handling of deferred priority change, and replace by setting the task priority directly, as required by AI-188. From-SVN: r125364
Diffstat (limited to 'gcc/ada/s-tasuti.adb')
-rw-r--r--gcc/ada/s-tasuti.adb12
1 files changed, 5 insertions, 7 deletions
diff --git a/gcc/ada/s-tasuti.adb b/gcc/ada/s-tasuti.adb
index 0d765df..6767f29 100644
--- a/gcc/ada/s-tasuti.adb
+++ b/gcc/ada/s-tasuti.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -43,7 +43,6 @@ with System.Tasking.Debug;
with System.Task_Primitives.Operations;
-- used for Write_Lock
--- Set_Priority
-- Wakeup
-- Unlock
-- Sleep
@@ -382,7 +381,7 @@ package body System.Tasking.Utilities is
-- Our parent should wait in Phase 1 of Complete_Master.
Master_Completion_Phase := 1;
- pragma Assert (Self_ID.Awake_Count = 1);
+ pragma Assert (Self_ID.Awake_Count >= 1);
end if;
-- We are accepting with a terminate alternative
@@ -454,8 +453,6 @@ package body System.Tasking.Utilities is
Write_Lock (C);
end loop;
- pragma Assert (P.Awake_Count /= 0);
-
if P.Common.State = Master_Phase_2_Sleep
and then C.Master_of_Task = P.Master_Within
then
@@ -478,7 +475,6 @@ package body System.Tasking.Utilities is
C.Awake_Count := C.Awake_Count - 1;
if Task_Completed then
- pragma Assert (Self_ID.Awake_Count = 0);
C.Alive_Count := C.Alive_Count - 1;
end if;
@@ -499,7 +495,9 @@ package body System.Tasking.Utilities is
loop
-- Notify P that C has gone passive
- P.Awake_Count := P.Awake_Count - 1;
+ if P.Awake_Count > 0 then
+ P.Awake_Count := P.Awake_Count - 1;
+ end if;
if Task_Completed and then C.Alive_Count = 0 then
P.Alive_Count := P.Alive_Count - 1;