diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-10-11 21:53:43 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-10-11 21:53:43 (GMT) |
| commit | 9c590fa6a6dee8482b2c829a97605c7cfb942d16 (patch) | |
| tree | 93cd8b32f1ef5d10e625b1a2cb721025739a1cc3 /unix/tclUnixThrd.c | |
| parent | 46cdee3dc8c8d96cb6a47aa9060de398693d9783 (diff) | |
| parent | 7dd13b72b6620cba05c004b954ea3df251420910 (diff) | |
| download | tcl-9c590fa6a6dee8482b2c829a97605c7cfb942d16.zip tcl-9c590fa6a6dee8482b2c829a97605c7cfb942d16.tar.gz tcl-9c590fa6a6dee8482b2c829a97605c7cfb942d16.tar.bz2 | |
merge trunk
Diffstat (limited to 'unix/tclUnixThrd.c')
| -rw-r--r-- | unix/tclUnixThrd.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c index 5030086..44c5607 100644 --- a/unix/tclUnixThrd.c +++ b/unix/tclUnixThrd.c @@ -662,7 +662,7 @@ void TclpInitAllocCache(void) { pthread_mutex_lock(allocLockPtr); - pthread_key_create(&key, TclpFreeAllocCache); + pthread_key_create(&key, NULL); pthread_mutex_unlock(allocLockPtr); } @@ -672,13 +672,19 @@ TclpFreeAllocCache( { if (ptr != NULL) { /* - * Called by the pthread lib when a thread exits + * Called by TclFinalizeThreadAllocThread() during the thread + * finalization initiated from Tcl_FinalizeThread() */ TclFreeAllocCache(ptr); pthread_setspecific(key, NULL); } else { + /* + * Called by TclFinalizeThreadAlloc() during the process + * finalization initiated from Tcl_Finalize() + */ + pthread_key_delete(key); } } |
