dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pnet-developers] Generic atexit function


From: Stephen Compall
Subject: Re: [Pnet-developers] Generic atexit function
Date: Mon, 28 Mar 2005 17:29:24 -0600

On Mon, 2005-03-28 at 22:25 +0100, Colin JN Breame wrote:
> Is there an equivalent of the C atexit function?  I can't find anything in 
> the 
> C# libraries, but maybe there is something pnet specific.

Environment.Exit calls TaskMethods.Exit, which internalcalls a function
in lib_task.c, which just calls exit(3).

I think the Right Thing to do in this case is to avoid using Exit at
all, define an exception captured in Main to be exit (much like Python
does with SystemExit, as well as ThreadDeath in Java), throw that
exception when you want to exit, and do cleanups in finally or catch
clauses (that rethrow out to Main).

-- 
Stephen Compall

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]