Boost logo

Boost :

From: Roland (roland.schwarz_at_[hidden])
Date: 2004-08-05 13:49:54


On Thu, 5 Aug 2004 12:56:40 -0400 Michael Glassford <glassfordm_at_[hidden]> wrote:

> The cleanup handlers being referred to in the comment are tls cleanup
> handlers. It has nothing to do with atexit:

I think I understand this yet. But I was suggesting that when you schedule a call
to atexit after all constructors have been run this handler will be called before
any of the global destructors are called (of course we are implying that at
this time all threads already have exited. Else there is still a problem.)

This behaviour seem to be standard. At least I found the following on the net:

-3- If a function is registered with atexit (see <cstdlib>, lib.support.start.term <lib-support.html>) then following the call to exit, any objects with static storage duration initialized prior to the registration of that function shall not be destroyed until the registered function is called from the termination process and has completed. For an object with static storage duration constructed after a function is registered with atexit, then following the call to exit, the registered function is not called until the execution of the object's destructor has completed. If atexit is called during the construction of an object, the complete object to which it belongs shall be destroyed before the registered function is called.

Roland


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk