diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-01-13 11:17:17 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-01-13 11:17:17 (GMT) |
commit | dcb024402d1a3c73cf744af89c99f82339dc215c (patch) | |
tree | 72c201f217d5ffed28bcd7ae7866f687633204d0 | |
parent | 7b39886f02248093aab85c82068ee768586cf19e (diff) | |
download | tcl-dcb024402d1a3c73cf744af89c99f82339dc215c.zip tcl-dcb024402d1a3c73cf744af89c99f82339dc215c.tar.gz tcl-dcb024402d1a3c73cf744af89c99f82339dc215c.tar.bz2 |
Patch from Zoran Vasiljevic, fix for missing proper initialization of the threaded allocator in some situations.
-rw-r--r-- | generic/tclEvent.c | 3 | ||||
-rw-r--r-- | generic/tclThreadAlloc.c | 1 | ||||
-rw-r--r-- | unix/tclUnixThrd.c | 2 |
3 files changed, 1 insertions, 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 |