From: "Jean-Pierre Rosen" <rosen@adalog.fr>
Subject: Re: Suspension_Object problem
Date: Wed, 15 Jan 2003 16:46:42 +0100
Date: 2003-01-15T16:46:42+01:00 [thread overview]
Message-ID: <b03vp9$jp1$1@s1.read.news.oleane.net> (raw)
In-Reply-To: 3E257FD5.8765352C@obs-vlfr.fr
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1607 bytes --]
"Philippe Laval" <laval@obs-vlfr.fr> a �crit dans le message de news: 3E257FD5.8765352C@obs-vlfr.fr...
> The following program compiles without error in gnat 3.14p.
> However the line "From H: P is now released" never shows up. What is
> wrong?
>
> -- File Susp_O.adb
> with P_Pkg;
> with H_Pkg;
> procedure Susp_O is
> begin
> null;
> end Susp_O;
> ----------------------------------------------------------------------------------------------
>
> -- File P_Pkg.ads
> with Ada.Synchronous_Task_Control; use Ada.Synchronous_Task_Control;
> package P_Pkg is
> protected type Protected_Lock is
> procedure Set_Lock;
> procedure Release;
> private
> Lock : Suspension_Object;
> end Protected_Lock;
>
> type Lock_Access is access Protected_Lock;
> Attack_Lock : Lock_Access;
>
> task P;
>
> end P_Pkg;
>
> ------------------------------------------------------------------------------------------------
>
> -- File P_Pkg.ads
> package H_Pkg is
> task H;
> end H_Pkg;
> ------------------------------------------------------------------------------------------------
>
> -- File P_Pkg.adb
> with Ada.Text_IO; use Ada.Text_IO;
> package body P_Pkg is
> protected body Protected_Lock is
> procedure Set_Lock is
> begin
> Suspend_Until_True (Lock);
> end Set_Lock;
>
Suspend_Until_True is a potentially blocking operation, and therefore not allowed in a protected procedure.
(D.10(10))
--
---------------------------------------------------------
J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr
next prev parent reply other threads:[~2003-01-15 15:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-15 15:35 Suspension_Object problem Philippe Laval
2003-01-15 15:46 ` Jean-Pierre Rosen [this message]
2003-01-15 19:02 ` Jeffrey Carter
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox