aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Ruiz <ruiz@act-europe.fr>2004-10-04 16:51:59 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2004-10-04 16:51:59 +0200
commit3b37ffbf15e7cc9e47a772f54de00bcec7737e74 (patch)
treed44b5671e604bd65bd2d1f9eefcae98b57c5edc2
parentb23e28d55eb5f3f601b309786fae3b262643d20e (diff)
downloadgcc-3b37ffbf15e7cc9e47a772f54de00bcec7737e74.zip
gcc-3b37ffbf15e7cc9e47a772f54de00bcec7737e74.tar.gz
gcc-3b37ffbf15e7cc9e47a772f54de00bcec7737e74.tar.bz2
s-tposen.adb (Service_Entry): The object must be always unlocked at the end of this procedure now that the...
2004-10-04 Jose Ruiz <ruiz@act-europe.fr> * s-tposen.adb (Service_Entry): The object must be always unlocked at the end of this procedure now that the unlock operation was inserted by the expander. From-SVN: r88489
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/s-tposen.adb59
2 files changed, 38 insertions, 27 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index f34a3a4..898395f 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,11 @@
2004-10-04 Jose Ruiz <ruiz@act-europe.fr>
+ * s-tposen.adb (Service_Entry): The object must be always unlocked at
+ the end of this procedure now that the unlock operation was inserted
+ by the expander.
+
+2004-10-04 Jose Ruiz <ruiz@act-europe.fr>
+
* targparm.ads, targparm.adb (Targparm_Tags): Add PAS value
corresponding to the Preallocated_Stacks flags in System.
(Get_Target_Parameters): Including the processing for
diff --git a/gcc/ada/s-tposen.adb b/gcc/ada/s-tposen.adb
index a992ed1..bb12679 100644
--- a/gcc/ada/s-tposen.adb
+++ b/gcc/ada/s-tposen.adb
@@ -574,43 +574,48 @@ package body System.Tasking.Protected_Objects.Single_Entry is
-------------------
procedure Service_Entry (Object : Protection_Entry_Access) is
- Self_Id : constant Task_Id := STPO.Self;
- Entry_Call : constant Entry_Call_Link := Object.Entry_Queue;
- Caller : Task_Id;
+ Self_Id : constant Task_Id := STPO.Self;
+ Entry_Call : constant Entry_Call_Link := Object.Entry_Queue;
+ Caller : Task_Id;
begin
- if Entry_Call /= null then
- if Object.Entry_Body.Barrier (Object.Compiler_Info, 1) then
- Object.Entry_Queue := null;
+ if Entry_Call /= null
+ and then Object.Entry_Body.Barrier (Object.Compiler_Info, 1)
+ then
+ Object.Entry_Queue := null;
- if Object.Call_In_Progress /= null then
- -- This violates the No_Entry_Queue restriction, send
- -- Program_Error to the caller.
+ if Object.Call_In_Progress /= null then
- Send_Program_Error (Self_Id, Entry_Call);
- Unlock_Entry (Object);
- return;
- end if;
+ -- Violation of No_Entry_Queue restriction, raise exception
- Object.Call_In_Progress := Entry_Call;
- Object.Entry_Body.Action
- (Object.Compiler_Info, Entry_Call.Uninterpreted_Data, 1);
- Object.Call_In_Progress := null;
- Caller := Entry_Call.Self;
+ Send_Program_Error (Self_Id, Entry_Call);
Unlock_Entry (Object);
+ return;
+ end if;
- if Single_Lock then
- STPO.Lock_RTS;
- end if;
+ Object.Call_In_Progress := Entry_Call;
+ Object.Entry_Body.Action
+ (Object.Compiler_Info, Entry_Call.Uninterpreted_Data, 1);
+ Object.Call_In_Progress := null;
+ Caller := Entry_Call.Self;
+ Unlock_Entry (Object);
- STPO.Write_Lock (Caller);
- Wakeup_Entry_Caller (Self_Id, Entry_Call, Done);
- STPO.Unlock (Caller);
+ if Single_Lock then
+ STPO.Lock_RTS;
+ end if;
- if Single_Lock then
- STPO.Unlock_RTS;
- end if;
+ STPO.Write_Lock (Caller);
+ Wakeup_Entry_Caller (Self_Id, Entry_Call, Done);
+ STPO.Unlock (Caller);
+
+ if Single_Lock then
+ STPO.Unlock_RTS;
end if;
+
+ else
+ -- Just unlock the entry
+
+ Unlock_Entry (Object);
end if;
exception