diff options
author | hobbs <hobbs@noemail.net> | 2004-07-21 01:30:56 (GMT) |
---|---|---|
committer | hobbs <hobbs@noemail.net> | 2004-07-21 01:30:56 (GMT) |
commit | c8c8ac6faa6c1e23ed232c07d17abf871019332f (patch) | |
tree | 485b0b4f6b33aad1eb86cc5ec0ddf7c71966fd7c /generic/tclThreadAlloc.c | |
parent | b33dda57bb359216c7a2aab539c536e5d7903ae2 (diff) | |
download | tcl-c8c8ac6faa6c1e23ed232c07d17abf871019332f.zip tcl-c8c8ac6faa6c1e23ed232c07d17abf871019332f.tar.gz tcl-c8c8ac6faa6c1e23ed232c07d17abf871019332f.tar.bz2 |
* generic/tclEvent.c: Correct threaded obj allocator to
* generic/tclInt.h: fully cleanup on exit and allow for
* generic/tclThreadAlloc.c: reinitialization. [Bug #736426]
* unix/tclUnixThrd.c: (mistachkin, kenny)
* win/tclWinThrd.c:
FossilOrigin-Name: 12bdd26d68349a144e518c4ffc10d6d5a59fb459
Diffstat (limited to 'generic/tclThreadAlloc.c')
-rwxr-xr-x | generic/tclThreadAlloc.c | 60 |
1 files changed, 59 insertions, 1 deletions
diff --git a/generic/tclThreadAlloc.c b/generic/tclThreadAlloc.c index 0023e35..1bd51e6 100755 --- a/generic/tclThreadAlloc.c +++ b/generic/tclThreadAlloc.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclThreadAlloc.c,v 1.4.2.2 2003/05/10 04:57:40 mistachkin Exp $ + * RCS: @(#) $Id: tclThreadAlloc.c,v 1.4.2.3 2004/07/21 01:30:57 hobbs Exp $ */ #if defined(TCL_THREADS) && defined(USE_THREAD_ALLOC) @@ -949,4 +949,62 @@ GetBlocks(Cache *cachePtr, int bucket) return 1; } +/* + *---------------------------------------------------------------------- + * + * TclFinalizeThreadAlloc -- + * + * This procedure is used to destroy all private resources used in + * this file. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +void +TclFinalizeThreadAlloc() +{ + int i; + for (i = 0; i < NBUCKETS; ++i) { + TclpFreeAllocMutex(binfo[i].lockPtr); + binfo[i].lockPtr = NULL; + } + + TclpFreeAllocMutex(objLockPtr); + objLockPtr = NULL; + + TclpFreeAllocMutex(listLockPtr); + listLockPtr = NULL; +} + +#else + +/* + *---------------------------------------------------------------------- + * + * TclFinalizeThreadAlloc -- + * + * This procedure is used to destroy all private resources used in + * this file. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +void +TclFinalizeThreadAlloc() +{ + Tcl_Panic("TclFinalizeThreadAlloc called when threaded memory allocator not in use."); +} + #endif /* TCL_THREADS */ |