summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlfb <lfb>1998-12-30 02:52:21 (GMT)
committerlfb <lfb>1998-12-30 02:52:21 (GMT)
commita680377f5ddddc62a98638e7ab6280eab77c939e (patch)
tree1617b32af67327d6691c48c2b521015b79bafc5a
parent1b6aa4a2fd7521a6e0249fcab56940aeee597c14 (diff)
downloadtk-a680377f5ddddc62a98638e7ab6280eab77c939e.zip
tk-a680377f5ddddc62a98638e7ab6280eab77c939e.tar.gz
tk-a680377f5ddddc62a98638e7ab6280eab77c939e.tar.bz2
Fixed problem with duplicate locking causing Wish to hang.
-rw-r--r--generic/tkWindow.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index cc174db..b638fc7 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWindow.c,v 1.1.4.3 1998/12/13 08:16:12 lfb Exp $
+ * RCS: @(#) $Id: tkWindow.c,v 1.1.4.4 1998/12/30 02:52:21 lfb Exp $
*/
#include "tkPort.h"
@@ -46,6 +46,7 @@ Tk_Uid tkNormalUid = NULL;
*/
TCL_DECLARE_MUTEX(windowMutex);
+TCL_DECLARE_MUTEX(uidMutex);
/*
* Default values for "changes" and "atts" fields of TkWindows. Note
@@ -258,15 +259,16 @@ CreateTopLevelWindow(interp, parent, name, screenName)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (!tsdPtr->initialized) {
- tsdPtr->initialized = 1;
if (tkNormalUid == NULL) {
- Tcl_MutexLock(&windowMutex);
+ Tcl_MutexLock(&uidMutex);
if (tkNormalUid == NULL) {
tkActiveUid = Tk_GetUid("active");
tkDisabledUid = Tk_GetUid("disabled");
tkNormalUid = Tk_GetUid("normal");
}
- Tcl_MutexUnlock(&windowMutex);
+ Tcl_MutexUnlock(&uidMutex);
+ tsdPtr->initialized = 1;
+
}
/*
@@ -2598,11 +2600,11 @@ DeleteWindowsExitProc(clientData)
tsdPtr->numMainWindows = 0;
tsdPtr->mainWindowList = NULL;
tsdPtr->initialized = 0;
- Tcl_MutexLock(&windowMutex);
+ Tcl_MutexLock(&uidMutex);
tkDisabledUid = NULL;
tkActiveUid = NULL;
tkNormalUid = NULL;
- Tcl_MutexUnlock(&windowMutex);
+ Tcl_MutexUnlock(&uidMutex);
}
/*