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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,73bdb823e1c1f689 X-Google-Attributes: gid103376,public From: Tom Moran Subject: Re: idiom for task termination? Date: 1997/02/11 Message-ID: <3300275D.5D94@bix.com>#1/1 X-Deja-AN: 218005250 references: <32FA10EF.32A@bix.com> <32FF32D7.67D2@elca-matrix.ch> content-type: text/plain; charset=us-ascii organization: InterNex Information Services 1-800-595-3333 mime-version: 1.0 reply-to: tmoran@bix.com newsgroups: comp.lang.ada x-mailer: Mozilla 3.01Gold (Win95; I) Date: 1997-02-11T00:00:00+00:00 List-Id: > But the question is, Does the select even have a terminate alternative? If > you need to do some work before you terminate - such as shut down a device > or close a file - then you have to be told explicity to shut down. I think if that was the problem then the 'last wishes' example in Burns & Wellings - declare a controlled type inside the task body and have its Finalize do the last wishes of the departing task - would work. But here I'm trying to execute a terminate alternative when the rules of Ada won't let me put in a terminate alternative. And more to the point, I want to gracefully catch a possible user error - failing to tell me to quit - with as little burden on the user as possible. (If the user didn't make mistakes, even during debugging, then he would have called my Quit routine.) If the user just does a 'with' of my package, and then the first statement of his program causes an unhandled exception, I really don't want to simply hang and force him to use the OS to abort the task and lose any exception information that might be present and useful. Various techniques come fairly close, but so far I've seen none that actually provide this.