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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,534dd301375921ac X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.191.225 with SMTP id hb1mr3643391pbc.5.1339708470908; Thu, 14 Jun 2012 14:14:30 -0700 (PDT) MIME-Version: 1.0 Path: l9ni51215pbj.0!nntp.google.com!news2.google.com!goblin3!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Is Text_IO.Put_Line() thread-safe? Date: Thu, 14 Jun 2012 21:14:25 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: Lf0Nl3CcQzx+ocHx9cmuGg.user.speranza.aioe.org X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Tom's custom newsreader Date: 2012-06-14T21:14:25+00:00 List-Id: > > It's a good idea to put an exception handler at the bottom of every > > task body, and do some debugging output there. Otherwise, an > > exception will cause the task to silently vanish. This is a > > language design flaw. > > It would be nice if the exception would propagate in the task's master, Not quite the same, but possibly useful: with Ada.Exceptions; procedure Testte is task type T is entry A; entry B(I : in Integer); entry C; end; task body T is Dummy : Natural := 1; begin accept A; select accept C; or delay 3.0; end select; Dummy := Dummy - 2; -- cause exception exception when Surprise: others => declare use Ada.Exceptions; Ea : Exception_Occurrence_Access := Save_Occurrence(Surprise); begin select accept A do Reraise_Occurrence(Ea.all);end; or accept B(I : in Integer) do Reraise_Occurrence(Ea.all);end; or accept C do Reraise_Occurrence(Ea.all);end; or terminate; -- died and nobody noticed! end select; end; end T; This : T; begin This.A; This.C; -- will cause This to have an internal, post-rendezvous, exception This.A; -- The next call on This will get that saved exception end Testte;