From f0747897b654c6b9937a82de4a78542646858ff2 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Fri, 19 Nov 2004 12:25:38 +0100 Subject: [PATCH] s-tposen.adb (Lock_Entry): Remove the code for raising Program_Error for Detect_Blocking which is... * s-tposen.adb (Lock_Entry): Remove the code for raising Program_Error for Detect_Blocking which is redundant with the check done within the procedure Protected_Single_Entry_Call. (Lock_Read_Only_Entry): Remove the code for raising Program_Error for Detect_Blocking which is redundant with the check done within the procedure Protected_Single_Entry_Call. From-SVN: r90913 --- gcc/ada/s-tposen.adb | 42 ++++++++++++++---------------------------- 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/gcc/ada/s-tposen.adb b/gcc/ada/s-tposen.adb index bb12679..7cbf84e 100644 --- a/gcc/ada/s-tposen.adb +++ b/gcc/ada/s-tposen.adb @@ -350,25 +350,18 @@ package body System.Tasking.Protected_Objects.Single_Entry is Ceiling_Violation : Boolean; begin - -- If pragma Detect_Blocking is active then Program_Error must - -- be raised if this potentially blocking operation is called from - -- a protected action, and the protected object nesting level - -- must be increased. + -- If pragma Detect_Blocking is active then the protected object + -- nesting level must be increased. if Detect_Blocking then declare Self_Id : constant Task_Id := STPO.Self; begin - if Self_Id.Common.Protected_Action_Nesting > 0 then - Ada.Exceptions.Raise_Exception - (Program_Error'Identity, "potentially blocking operation"); - else - -- We are entering in a protected action, so that we - -- increase the protected object nesting level. - - Self_Id.Common.Protected_Action_Nesting := - Self_Id.Common.Protected_Action_Nesting + 1; - end if; + -- We are entering in a protected action, so that we + -- increase the protected object nesting level. + + Self_Id.Common.Protected_Action_Nesting := + Self_Id.Common.Protected_Action_Nesting + 1; end; end if; @@ -390,25 +383,18 @@ package body System.Tasking.Protected_Objects.Single_Entry is Ceiling_Violation : Boolean; begin - -- If pragma Detect_Blocking is active then Program_Error must be - -- raised if this potentially blocking operation is called from a - -- protected action, and the protected object nesting level must - -- be increased. + -- If pragma Detect_Blocking is active then the protected object + -- nesting level must be increased. if Detect_Blocking then declare Self_Id : constant Task_Id := STPO.Self; begin - if Self_Id.Common.Protected_Action_Nesting > 0 then - Ada.Exceptions.Raise_Exception - (Program_Error'Identity, "potentially blocking operation"); - else - -- We are entering in a protected action, so that we - -- increase the protected object nesting level. - - Self_Id.Common.Protected_Action_Nesting := - Self_Id.Common.Protected_Action_Nesting + 1; - end if; + -- We are entering in a protected action, so that we + -- increase the protected object nesting level. + + Self_Id.Common.Protected_Action_Nesting := + Self_Id.Common.Protected_Action_Nesting + 1; end; end if; -- 2.7.4