diff options
author | hobbs <hobbs> | 2000-04-20 01:30:19 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2000-04-20 01:30:19 (GMT) |
commit | 4e8cc6920798eaa803c47afc4e599cb680d2b459 (patch) | |
tree | 19919ac6b35eee37554b245875994c9bb3df6434 /win/tclWinThrd.c | |
parent | 0c6a6f1849328a298f5145a93e0ffa4ecc43c8f4 (diff) | |
download | tcl-4e8cc6920798eaa803c47afc4e599cb680d2b459.zip tcl-4e8cc6920798eaa803c47afc4e599cb680d2b459.tar.gz tcl-4e8cc6920798eaa803c47afc4e599cb680d2b459.tar.bz2 |
* library/dde1.1/pkgIndex.tcl:
* library/reg1.0/pkgIndex.tcl:
* win/tclWinChan.c:
* win/tclWinThrd.c: converted CRLF to LF the */tcl.hpj.in files
were not converted, as it confuses hcw locally. [Bug: 5096]
* win/Makefile.in: expanded cleanup or help files
* doc/Thread.3: minor macro cleanup
Diffstat (limited to 'win/tclWinThrd.c')
-rw-r--r-- | win/tclWinThrd.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/win/tclWinThrd.c b/win/tclWinThrd.c index e3227b1..8fe2596 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.7 2000/04/17 20:32:26 welch Exp $ + * RCS: @(#) $Id: tclWinThrd.c,v 1.8 2000/04/20 01:30:20 hobbs Exp $ */ #include "tclWinInt.h" @@ -42,7 +42,7 @@ static CRITICAL_SECTION initLock; */ static CRITICAL_SECTION allocLock; -static Tcl_Mutex allocLockPtr = (Tcl_Mutex) &allocLock;
+static Tcl_Mutex allocLockPtr = (Tcl_Mutex) &allocLock; /* * Condition variables are implemented with a combination of a @@ -203,17 +203,17 @@ Tcl_GetCurrentThread() void TclpInitLock() { - if (!init) {
- /*
- * There is a fundamental race here that is solved by creating
- * the first Tcl interpreter in a single threaded environment.
- * Once the interpreter has been created, it is safe to create
- * more threads that create interpreters in parallel.
- */
- init = 1;
- InitializeCriticalSection(&initLock);
- InitializeCriticalSection(&masterLock);
- }
+ if (!init) { + /* + * There is a fundamental race here that is solved by creating + * the first Tcl interpreter in a single threaded environment. + * Once the interpreter has been created, it is safe to create + * more threads that create interpreters in parallel. + */ + init = 1; + InitializeCriticalSection(&initLock); + InitializeCriticalSection(&masterLock); + } EnterCriticalSection(&initLock); } @@ -302,8 +302,8 @@ TclpMasterLock() Tcl_Mutex * Tcl_GetAllocMutex() { -#ifdef TCL_THREADS
- InitializeCriticalSection(&allocLock);
+#ifdef TCL_THREADS + InitializeCriticalSection(&allocLock); return &allocLockPtr; #else return NULL; |