summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authordavygrvy <davygrvy@pobox.com>2004-04-27 17:17:37 (GMT)
committerdavygrvy <davygrvy@pobox.com>2004-04-27 17:17:37 (GMT)
commit7f97c937b35654a9f152c4f9a9f73f697a073efe (patch)
treefe34d28761ed122feeda45f95a0e66acc2fa6bc2 /win
parent5da08b4c921f9c3f0e6c5c7049595fa6dc33f3b4 (diff)
downloadtcl-7f97c937b35654a9f152c4f9a9f73f697a073efe.zip
tcl-7f97c937b35654a9f152c4f9a9f73f697a073efe.tar.gz
tcl-7f97c937b35654a9f152c4f9a9f73f697a073efe.tar.bz2
A little source clean-up with the allocOnce variable.
Diffstat (limited to 'win')
-rw-r--r--win/tclWinThrd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/win/tclWinThrd.c b/win/tclWinThrd.c
index 80ef5ed..88e2cda 100644
--- a/win/tclWinThrd.c
+++ b/win/tclWinThrd.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinThrd.c,v 1.29 2004/04/23 07:21:41 davygrvy Exp $
+ * RCS: @(#) $Id: tclWinThrd.c,v 1.30 2004/04/27 17:17:37 davygrvy Exp $
*/
#include "tclWinInt.h"
@@ -25,7 +25,6 @@
static CRITICAL_SECTION masterLock;
static int init = 0;
-static int allocOnce = 0;
#define MASTER_LOCK EnterCriticalSection(&masterLock)
#define MASTER_UNLOCK LeaveCriticalSection(&masterLock)
@@ -45,6 +44,7 @@ static CRITICAL_SECTION initLock;
static CRITICAL_SECTION allocLock;
static Tcl_Mutex allocLockPtr = (Tcl_Mutex) &allocLock;
+static int allocOnce = 0;
#endif /* TCL_THREADS */
@@ -430,9 +430,11 @@ TclFinalizeLock ()
DeleteCriticalSection(&masterLock);
init = 0;
#ifdef TCL_THREADS
- DeleteCriticalSection(&allocLock);
+ if (allocOnce) {
+ DeleteCriticalSection(&allocLock);
+ allocOnce = 0;
+ }
#endif
- allocOnce = 0;
/* Destroy the critical section that we are holding. */
DeleteCriticalSection(&initLock);
}