comp.lang.ada
 help / color / mirror / Atom feed
* Re: Recursive Protected types getting deadlocked!
       [not found] <199709090355.UAA29772@wanchai.aisf.com>
@ 1997-09-09  0:00 ` Chris Sparks (Mr. Ada)
  0 siblings, 0 replies; only message in thread
From: Chris Sparks (Mr. Ada) @ 1997-09-09  0:00 UTC (permalink / raw)



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




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1997-09-09  0:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <199709090355.UAA29772@wanchai.aisf.com>
1997-09-09  0:00 ` Recursive Protected types getting deadlocked! Chris Sparks (Mr. Ada)

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