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,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!a6g2000yqm.googlegroups.com!not-for-mail From: =?ISO-8859-2?Q?Maksymilian_Bogu=F1?= Newsgroups: comp.lang.ada Subject: Array not updated in procedure in protected type Date: Fri, 22 Jan 2010 08:26:51 -0800 (PST) Organization: http://groups.google.com Message-ID: <3e834b40-609f-47a1-87bc-1b653098b140@a6g2000yqm.googlegroups.com> NNTP-Posting-Host: 84.10.154.219 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1264177611 31498 127.0.0.1 (22 Jan 2010 16:26:51 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 22 Jan 2010 16:26:51 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: a6g2000yqm.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:8814 Date: 2010-01-22T08:26:51-08:00 List-Id: 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? Cheers, -- Max