From d36c7ebb004e73122c76276b854364f543458b8c Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Thu, 24 Sep 2015 16:53:18 -0700 Subject: [PATCH] Work around an NPTL-specific TSD issue. Work around a potentially bad thread-specific data initialization interaction with NPTL (glibc's pthreads implementation). This resolves #283. --- ChangeLog | 2 ++ src/tsd.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index a9929f82..b7381a58 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,8 @@ brevity. Much more detail can be found in the git revision history: when resizing from/to a size class that is not a multiple of the chunk size. - Fix prof_tctx_dump_iter() to filter out nodes that were created after heap profile dumping started. + - Work around a potentially bad thread-specific data initialization + interaction with NPTL (glibc's pthreads implementation). * 4.0.2 (September 21, 2015) diff --git a/src/tsd.c b/src/tsd.c index 2100833a..9ffe9afe 100644 --- a/src/tsd.c +++ b/src/tsd.c @@ -73,6 +73,9 @@ tsd_cleanup(void *arg) tsd_t *tsd = (tsd_t *)arg; switch (tsd->state) { + case tsd_state_uninitialized: + /* Do nothing. */ + break; case tsd_state_nominal: #define O(n, t) \ n##_cleanup(tsd);