s-tposen.adb (Lock_Entry): Remove the code for raising Program_Error for Detect_Block...
authorArnaud Charlet <charlet@gcc.gnu.org>
Fri, 19 Nov 2004 11:25:38 +0000 (12:25 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 19 Nov 2004 11:25:38 +0000 (12:25 +0100)
* 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

index bb1267969c1ce4cd50b31a6eb8283fd0790f4cec..7cbf84e6ded98421a7b357ec9d0bd454bbcd2b04 100644 (file)
@@ -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;