Boost logo

Boost :

From: Baptiste Lepilleur (blepctc_at_[hidden])
Date: 2004-10-22 02:43:58


    I think there is a bug related to the fact that global static variable
initialization order is undefined.

    tls_data is a global variable which is initialized indirectly by
tss::init().

    thread_specific_ptr<> instance usually also global static variable and
call tss::init() in their constructor.

    Both being global static variable, their initialization order is
unspecified, and error may occurs if thread_specific_ptr<> is initialized
before tls_data.

    Questions: wouldn't it be possible to get ride of the tls_data memory
leak, by using a by value tls_data static data instead of a pointer, and
calling pthread_key_delete() to ensure callback are no longer called ?

    Baptiste.


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