Initialize all members of non-TLS tsd wrapper when creating it

Not setting the initialized member leads to randomly calling the cleanup
function in cases it shouldn't be called (and isn't called in other
implementations).
This commit is contained in:
Mike Hommey 2012-04-18 18:29:47 +02:00 committed by Jason Evans
parent 86e58583bb
commit 7ff1ce4131

View File

@ -253,6 +253,7 @@ a_name##_tsd_get_wrapper(void) \
} else { \ } else { \
static a_type tsd_static_data = a_initializer; \ static a_type tsd_static_data = a_initializer; \
wrapper->isstatic = false; \ wrapper->isstatic = false; \
wrapper->initialized = false; \
wrapper->val = tsd_static_data; \ wrapper->val = tsd_static_data; \
} \ } \
if (pthread_setspecific(a_name##_tsd, \ if (pthread_setspecific(a_name##_tsd, \