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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,4b557b59ad54d752 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!postnews.google.com!l19g2000yqb.googlegroups.com!not-for-mail From: =?UTF-8?Q?Maksymilian_Bogu=C5=84?= Newsgroups: comp.lang.ada Subject: Re: Array not updated in procedure in protected type Date: Sat, 23 Jan 2010 08:37:15 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <3e834b40-609f-47a1-87bc-1b653098b140@a6g2000yqm.googlegroups.com> NNTP-Posting-Host: 84.10.154.219 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1264264635 17850 127.0.0.1 (23 Jan 2010 16:37:15 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 23 Jan 2010 16:37:15 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l19g2000yqb.googlegroups.com; posting-host=84.10.154.219; posting-account=g8uKygoAAAD2D-PE88eMKH4dlOYU6bEV User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 (.NET CLR 3.5.30729),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:8817 Date: 2010-01-23T08:37:15-08:00 List-Id: On 22 Sty, 17:51, xavier grave wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Maksymilian Bogu=C5=84 a =C3=A9crit : > > > > > 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 :=3D Birds(Bird_I); > > if not My_Bird.Alive then > > =C2=A0 =C2=A0return; > > end if; > > My_Bird.Alive :=3D False; > > Birds(Bird_I) :=3D 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 > =3Dod/+ > -----END PGP SIGNATURE----- Ah, nevermind, I solved the problem - it was a race condition in a totally different part of the program :) I really hate multithreaded programming :( Cheers, -- Max