comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: SPARK 2014 and protected objects
Date: Wed, 31 Aug 2016 08:42:49 +0100
Date: 2016-08-31T08:42:49+01:00	[thread overview]
Message-ID: <ly8tvdidty.fsf@pushface.org> (raw)
In-Reply-To: 2a104643-59b9-4a46-b543-5c124984bf43@googlegroups.com

Shark8 <onewingedshark@gmail.com> writes:

>    protected Impl
>      with Part_Of => State
>    is
>       procedure Set (Value : Integer)
>         with Depends => ((Impl =>+ Value));
>       procedure Get (Value : out Integer)
>         with Depends => (Impl => Impl, Value => Impl);
>
>    private
> 	Protected_Value : Integer := 0;
>    end Impl;
>     
>     -- GNAT doesn't allow Volatile on the protected object's with.
>     Pragma Volatile(Impl);

We seem to have come up with (almost) the same solution, which gives me
confidence it's the right one. Thanks.

I had Protected_Value outside the PO because it's standing in for a
number of I/O registers communicating with devices on a shared SPI bus
via their /Chip Select lines. Not sure how to deal with the concept of
"a number of machine registers"!

  reply	other threads:[~2016-08-31  7:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-30 10:34 SPARK 2014 and protected objects Simon Wright
2016-08-30 14:45 ` Shark8
2016-08-30 15:33   ` Simon Wright
2016-08-30 18:42     ` Simon Wright
2016-08-30 18:47     ` Simon Wright
2016-08-31  0:11 ` Shark8
2016-08-31  7:42   ` Simon Wright [this message]
2016-08-31 15:41     ` Shark8
2016-08-31 20:55       ` Simon Wright
2016-09-01 20:07         ` Shark8
replies disabled

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