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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.ams3.giganews.com!backlog3.nntp.ams3.giganews.com!backlog3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Natasha Kerensikova Newsgroups: comp.lang.ada Subject: Re: Termination of tasks waiting on a protected queue Date: Sun, 18 May 2014 19:43:41 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: Injection-Date: Sun, 18 May 2014 19:43:41 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="76a49b86bc3e16725b7cfca3d85cb4c8"; logging-data="22427"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19OWGZnB6lq1cD8is++bbm9" User-Agent: slrn/1.0.1 (FreeBSD) Cancel-Lock: sha1:8Od6/7GC6r+XZ3Derhgdzb5oMSU= X-Original-Bytes: 1916 Date: 2014-05-18T19:43:41+00:00 List-Id: Hello, On 2014-05-18, anon@att.net wrote: > try using a Select / terminate statements It does not work. In the code below, "select" is immediately followed by "Queue.Get_Next (Job)", which is an entry call, so the "select" can be a timed entry call, a conditional entry call, or an asynchronous transfer of control, but not a selective accept. However, terminate alternatives can exist only in selective accepts. > task body Worker is > Job : Job_Description; > begin > loop > select > Queue.Get_Next (Job); > > or > terminate ; > end select ; > end loop; > end Worker; To put in GNAT's terms: 68. terminate ; 12 >>> statement expected >>> only allowed alternative in timed entry call is delay