[Top][All Lists]

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

Re: Windows Build: feature branch, src/exithandle.c,

From: Derek Robert Price
Subject: Re: Windows Build: feature branch, src/exithandle.c,
Date: Sat, 15 May 2004 21:20:21 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413

Hash: SHA1

Conrad T. Pino wrote:

>Hi Larry,
>>From: Larry Jones [mailto:lawrence.jones@ugsplm.com]
>>That just silences the warning, it doesn't fix the problem.  As I said
>>before, the problem is that signal handlers take one argument and exit
>>handlers take no arguments, but we're trying to use the same functions
>>for both -- you can't do that because the two different function types
>>could have completely different calling conventions.  The only way to
>>fix the problem is to have two separate functions (although one could
>>just be a wrapper for the other), but it's not clear that it's worth it
>>since the problem is purely theoretical -- there are no known
>>implementations where the current code actually fails.
>This is a distributed wrapper solution where prior solution used
>a central wrapper solution with management overhead.

This thread prompted me to clean up identical inchoherent comments in
server_cleanup, rcs_cleanup, and Lock_Cleanup and I noticed that I had
at one point put code into each function to avoid running the
functions twice after the exit() that is always called at the end of
main_cleanup() goes and causes all the functions registered via
atexit() to be called.

So, how about his much simpler idea:  Only register main_cleanup() as
a signal handler and let all the other cleanup functions be called via
atexit() and exit()?

The only drawback is that if one of the exit handlers is interrupted
by a signal, then it won't be called again via the second call to
atexit(), but it's possible that this could be coded around.


- --

Email: derek@ximbiot.com

Get CVS support at <http://ximbiot.com>!
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


reply via email to

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