Boost logo

Boost :

From: Roland (roland.schwarz_at_[hidden])
Date: 2004-07-28 04:43:45


On Wed, 28 Jul 2004 11:12:34 +0200 Bronek Kozicki <brok_at_[hidden]> wrote:

> Roland wrote:
> > DLL_THREAD_DETACH might already be too late for cleanup.
> > You are relying on the fact that the c-runtime (with respect to this very thread)
> > is still in a sane state! In fact it might not since the runtimes own detach functions
>
> Hm? After some checking I can see that TLS can be freed after thread
> termination, see:
> http://msdn.microsoft.com/library/en-us/dllproc/base/thread_local_storage.asp
> What worries me is TlsFree documentation, saying "It is expected that
> DLLs call this function (if at all) only during DLL_PROCESS_DETACH.".

This is true, but the global object itself usually "lives" in an object, which you "normally"
need to free by means of the delete operator which in turn relies on availability of
the c-runtime.

Have a look at the current implementation of the thread_specific_pointer which calls
delete on the object to free the heap when the thread is done.

Roland


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