Possible bug in thread/tss.cpp

22 Oct
2004
22 Oct
'04
7:43 a.m.
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.
7539
Age (days ago)
7539
Last active (days ago)
0 comments
1 participants
participants (1)
-
Baptiste Lepilleur