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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6a0d121b8e66f48a,start X-Google-Attributes: gid103376,public From: "Chris Sparks (Mr. Ada)" Subject: Re: Recursive Protected types getting deadlocked! Date: 1997/09/09 Message-ID: <341560D3.711A@aisf.com>#1/1 X-Deja-AN: 271014304 Sender: Ada programming language References: <199709090355.UAA29772@wanchai.aisf.com> Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU Organization: Boeing Newsgroups: comp.lang.ada Date: 1997-09-09T00:00:00+00:00 List-Id: Tucker Taft wrote: > > Dale Stanbrough (dale@goanna.cs.rmit.EDU.AU) wrote: > > > > : I've written a small semaphore that records the task id of the owner, > > : allowing recusive lock taking (i'm looking at how Java tasking works). > > > > : The following code seems to deadlock however. It seems that when a > > : 2nd task is woken up on the Queued entry, it does so in the context > > : of the first Task (or so the Image function tells me...). > > > > : This to me seems very strange. Is it likely to be an error in Gnat, > > : or is it a misunderstanding on my part as to how this all works... > > > Any "convenient" thread may perform an entry body (RM95 9.5.3(22)). > This flexibility can be critical to minimizing unnecessary context > switches and lock transfers. Hence, asking for "Current_Task" from > inside an entry body is not useful. If you need to get the > identity of the thread which initiated an entry call, use > the 'Caller attribute (C.7.1(14)). > > For example, inside Seize you should use "Seize'Caller" > rather than "Current_Task"; inside Release you should use > "Release'Caller". Release is a procedure not an entry. Maybe you meant the entry "Queue". Chris Sparks