Combining entry_call, accept_statment and terminate_statment

From: Lutz Donnerhacke (lutz_at_iks-jena.de)
Date: 03/29/04


Date: Mon, 29 Mar 2004 19:41:34 +0000 (UTC)

Sorry, but I do not get it:

I have a protected type with an entry:

  protected type PT is
     entry X;
  end PT;
  p : PT;

Now I have to construct a task dealing with new data from the protected
type, an call from other tasks or the termination of the parent task.
  task type TT is
     entry Config;
  end TT;
  
  task body TT is
  begin
     loop
        select
           p.X;
           -- dealing with new data
        or accept Config;
           -- modify the task
        or terminate;
        end select;
     end loop;
  end TT;

Unfortunly this is not allowed. Either accept and terminate or an entry_call
and a delay can be combinded. I wonder how to solve such as deadlock. It
should be a common idiom, but I had no luck in choosing searching keywords.

Any hint?



Relevant Pages

  • Re: Signal handler blocks proteced type
    ... > A protected type with a signal handler is instantiated in order to catch a ... Attach_Handler works fine (termination of the enviroment task succeeds). ... Any call to Detach_Handler after a signal delivery results in a blocking ...
    (comp.lang.ada)
  • Task vs Protected Type
    ... I would like to understand a sentence of the wikibook. ... entry Initialize; ... this is a protected type with exclusive mutex on entry and procedure and absolutly no thread implementation ...
    (comp.lang.ada)
  • Re: Synchronizing on multiple distinict resources
    ... > protected type Chop_Stick is ... entry Release; ... requeue Release; ...
    (comp.lang.ada)
  • Re: Combining entry_call, accept_statment and terminate_statment
    ... > I have a protected type with an entry: ... example that emulates a just in time production line. ...
    (comp.lang.ada)
  • Re: protected type interrupts
    ... protected type for an interrupt handler. ... simply sets a boolean to true that an entry is using as a guard. ... If a call to a procedure or entry of a protected object changes the barrier on another entry to True, the thread of control that changed the barrier is allowed to execute the newly open entry on behalf of the task that called it. ...
    (comp.lang.ada)