From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!news.in2p3.fr!in2p3.fr!not-for-mail From: xavier grave Newsgroups: comp.lang.ada Subject: Re: Array not updated in procedure in protected type Date: Fri, 22 Jan 2010 17:51:40 +0100 Organization: In2p3 Message-ID: References: <3e834b40-609f-47a1-87bc-1b653098b140@a6g2000yqm.googlegroups.com> NNTP-Posting-Host: ipnnarval.in2p3.fr Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: ccpntc8.in2p3.fr 1264179100 13599 134.158.92.7 (22 Jan 2010 16:51:40 GMT) X-Complaints-To: newsmaster@cc.in2p3.fr NNTP-Posting-Date: Fri, 22 Jan 2010 16:51:40 +0000 (UTC) User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090707) In-Reply-To: <3e834b40-609f-47a1-87bc-1b653098b140@a6g2000yqm.googlegroups.com> X-Enigmail-Version: 0.95.0 Xref: g2news1.google.com comp.lang.ada:8815 Date: 2010-01-22T17:51:40+01:00 List-Id: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Maksymilian Boguń a écrit : > Hi! > I created a protected object with a private array of records. When I > want to update the elements of this array, I use a procedure in this > protected object. The important part is: > > My_Bird := Birds(Bird_I); > if not My_Bird.Alive then > return; > end if; > My_Bird.Alive := False; > Birds(Bird_I) := My_Bird; > > When running with debugger, I can see, that Birds(Bird_I).Alive is > False after this code is executed. However, when I switch to another > task and call this procedure again Birds(Bird_I).Alive is still True. > The array is not modified anywhere else, only through this protected > object. What is wrong, why doesn't it work? Can you add a little more code ? the protected type declaration for example or best of all : a simple test_case where this code is ? xavier -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAktZ15wACgkQVIZi0A5BZF4yzwCeM7Zhw5LlstKVWpciBpDliZhC JLMAoKxC6mE4Zge8Ejj/mKJOdD6yAx0G =od/+ -----END PGP SIGNATURE-----