From dcb024402d1a3c73cf744af89c99f82339dc215c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 13 Jan 2017 11:17:17 +0000 Subject: Patch from Zoran Vasiljevic, fix for missing proper initialization of the threaded allocator in some situations. --- generic/tclEvent.c | 3 --- generic/tclThreadAlloc.c | 1 + unix/tclUnixThrd.c | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/generic/tclEvent.c b/generic/tclEvent.c index 0eabc13..b0b8188 100644 --- a/generic/tclEvent.c +++ b/generic/tclEvent.c @@ -1043,9 +1043,6 @@ TclInitSubsystems(void) #if USE_TCLALLOC TclInitAlloc(); /* Process wide mutex init */ #endif -#if defined(TCL_THREADS) && defined(USE_THREAD_ALLOC) - TclpInitAllocCache(); -#endif #ifdef TCL_MEM_DEBUG TclInitDbCkalloc(); /* Process wide mutex init */ #endif diff --git a/generic/tclThreadAlloc.c b/generic/tclThreadAlloc.c index 2ee758e..fc281db 100644 --- a/generic/tclThreadAlloc.c +++ b/generic/tclThreadAlloc.c @@ -210,6 +210,7 @@ GetCache(void) 1 << (NBUCKETS - 2 - i) : 1; bucketInfo[i].lockPtr = TclpNewAllocMutex(); } + TclpInitAllocCache(); } Tcl_MutexUnlock(initLockPtr); } diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c index 7394545..805599d 100644 --- a/unix/tclUnixThrd.c +++ b/unix/tclUnixThrd.c @@ -711,9 +711,7 @@ TclpFreeAllocMutex( void TclpInitAllocCache(void) { - pthread_mutex_lock(allocLockPtr); pthread_key_create(&key, NULL); - pthread_mutex_unlock(allocLockPtr); } void -- cgit v0.12