comp.lang.ada
 help / color / mirror / Atom feed
From: russ lyttle <lyttlec@removegmail.com>
Subject: Re: Gnat Problem - Freezing too soon
Date: Fri, 1 Mar 2019 16:50:10 -0500
Date: 2019-03-01T16:50:10-05:00	[thread overview]
Message-ID: <q5c9eg$1fsp$1@gioia.aioe.org> (raw)
In-Reply-To: bba6782d-d9da-44ad-af51-039ff8b4be37@googlegroups.com

On 3/1/19 11:54 AM, Anh Vo wrote:
> On Friday, March 1, 2019 at 6:21:26 AM UTC-8, russ lyttle wrote:
>> On 2/28/19 7:49 PM, Anh Vo wrote:
>>> On Thursday, February 28, 2019 at 2:11:11 PM UTC-8, russ lyttle wrote:
>>>> On 2/28/19 4:22 PM, Simon Wright wrote:
>>>>> russ lyttle <lyttlec@removegmail.com> writes:
>>>>>
>>>>>> Example from the bookAnalysable Real-Time Systems :
>>>>>>
>>> ---------
>>>>
>>>> Would I be submitting a bug report against an already patched version of
>>>> gnat?
>>>
>>> Again, please post sporadics.ads in its entirety. So, we can duplicate your finding or not.
>>>    
>>>
>> Thanks for responding. We found it definitely a bug in gnat and are
>> submitting a bug report.
> 
> It is fine to send in a report if you are confident that it is a bug in latest GNAT. Otherwise, we would like to see the content of sporadics.ads. So, we can either confirm or not your finding.
>   
> 
Here they are. These are from Analysable Real-Time Systems Progrmmed in 
Ada, Chap.20, Pg. 472-473. Line 29 gives different error from line 44.

Full code for sporadics.ads:

with System; use System;
with Ada.Real_Time; use Ada.Real_Time;
package Sporadics is

    type Sporadic_Invoke_Interface is Synchronized Interface;
    procedure Start (S: in out Sporadic_Invoke_Interface)
       is abstract;
    type Any_Sporadic_Invoke_Interface is access all
      Sporadic_Invoke_Interface'Class;

    type Sporadic_Thread_Interface is Synchronized Interface;
    procedure Wait_Start (S: in out Sporadic_Thread_Interface)
       is abstract;
    type Any_Sporadic_Thread_Interface is access all
      Sporadic_Thread_Interface'Class;

    type Sporadic_State is abstract tagged
       record
	 Pri : Priority;
	 Ceiling_Priority : Priority;
	 MIT_In_Mili : Time_Span;
       end record;
    procedure Initialize_Code (S: in out Sporadic_State)
       is abstract;
    procedure Sporadic_Code (S: in out Sporadic_State)
       is abstract;
    type Any_Sporadic_State is access all Sporadic_State'Class;

    protected type Sporadic_Agent (S: Any_Sporadic_State)
      --with Priority => S.Ceiling_Prioriy
    is
       new Sporadic_Invoke_Interface and
           Sporadic_Thread_Interface
      with
      -- for the Start operation
      overriding procedure Start;
      overriding entry Wait_Start;
    private
       Start_Open : Boolean := False;
    end Sporadic_Agent;

    task type Sporadic (S : Any_Sporadic_State;
		       A : Any_Sporadic_Thread_Interface)
      with Priority => S.pri
        is

    end Sporadic;
end Sporadics;
-----------------------------------------------------------------------
Full code for sporadics.adb:
package body Sporadics is
    protected body Sporadic_Agent is
       procedure Start is
       begin
	 Start_Open := False;
       end Start;

       entry Wait_Start
       when Start_Open is
       begin
	 Start_Open := False;
       end Wait_Start;
    end Sporadic_Agent;

       task body Sporadic is
       begin
	 S.Initialize_Code;
	 loop
	    A.Wait_Start;
	    S.Sporadic_Code;
	 end loop;
       end Sporadic;
    end Sporadics;

  reply	other threads:[~2019-03-01 21:50 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-28 18:34 Gnat Problem - Freezing too soon russ lyttle
2019-02-28 21:19 ` Anh Vo
2019-02-28 21:31   ` russ lyttle
2019-02-28 21:22 ` Simon Wright
2019-02-28 22:11   ` russ lyttle
2019-03-01  0:49     ` Anh Vo
2019-03-01 14:21       ` russ lyttle
2019-03-01 16:54         ` Anh Vo
2019-03-01 21:50           ` russ lyttle [this message]
2019-03-02  1:08             ` Anh Vo
2019-03-02  3:55               ` russ lyttle
2019-03-02  5:50                 ` Anh Vo
2019-03-02 20:19                   ` russ lyttle
2019-03-02 21:35                     ` Simon Wright
2019-03-03 20:42                       ` russ lyttle
2019-03-03 21:26                         ` Simon Wright
2019-03-04  0:33                           ` russ lyttle
2019-03-02 14:09             ` Simon Wright
2019-03-01  8:12     ` Simon Wright
2019-03-01 14:17       ` russ lyttle
2019-03-01 18:10     ` Simon Wright
2019-03-01 21:35       ` russ lyttle
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox