+ -- This is a potentially blocking (see ARM D.10, par. 10), so that
+ -- if pragma Detect_Blocking is active then Program_Error must be
+ -- raised if this operation is called from a protected action.
+
+ if System.Tasking.Detect_Blocking
+ and then System.Tasking.Self.Common.Protected_Action_Nesting > 0
+ then
+ Ada.Exceptions.Raise_Exception
+ (Program_Error'Identity, "potentially blocking operation");
+ end if;
+
+ System.Task_Primitives.Operations.Suspend_Until_True (S.SO);