This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: SetupXP


Gary R. Van Sickle wrote:
>> On Sat, 2003-07-19 at 11:32, Gary R. Van Sickle wrote:
>>
>>>> Wait! The status quo must remain, until we have confirmed evidence that
>>>> static destructors do always run on exit from -mno-cygwin programs.
>>>
>>> As Rob said, he's said that too.  What am I missing?  Neither of
>> LogFile's nor
>>> LogSingleton's destructors do anything, and this change doesn't remove
the
>>> "theLog->exit (0);" at the end of main() (the only place its'
>> called with 0),
>>> so... where's the connection?
>>
>> Well, there are two things.
>> We used to call ExitProcess(), which (obviously) didn't call
>> destructors.
>> Secondly, the destructors do nothing because they where not (and we
>> haven't tested conclusively if they are nnow) called when ::exit() is
>> invoked. The functionality in LogFile::exit() for flushing the log file
>> on exit is appropriate to be put in the destructor - flush on cygwin
>> exit. We can't put that there until we are sure destructors execute.
>>
>> The goal long term is to be able to exit() without worrying about the
>> log (or any other related caching logic).
>>
>> Does that clear up the connection?
>
> Not really, because my change isn't doing anything whatsoever to the file
> flush logic.  LogFile::exit() still gets called everywhere it did before.

OK, putting it another way:

We currently don't trust destructors to be called on exit. (Preliminary
tests seem to show that they are now, though.)
Until we are *sure* that destructors will run, we cannot use them for
anything important.
Writing the log and re-enabling the antivirus are important.
Therefore, we try to always exit through a function (LogFile::exit) of our
own, which guarantees cleanup will run.

Until all the cleanup code is in destructors, LogFile::exit will retain its
special status as exit point.
So, your change doesn't change behaviour, and doesn't significantly refactor
towards our eventual destination.
Therefore, we don't see any reason for it.

So, please revert it from your local copy, including the changes to comments
in main.cc.

Please also revert the caption changes in res.rc, since I have submitted a
separate patch for that.

Then re-issue your patch, and either select an aspect you would like to
discuss next, or I will choose one.

Thanks,

Max.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]