summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixNotfy.c
diff options
context:
space:
mode:
authorhobbs <hobbs@noemail.net>1999-10-30 11:09:42 (GMT)
committerhobbs <hobbs@noemail.net>1999-10-30 11:09:42 (GMT)
commit19d37cea3398c5d08431fc9346d9dc7aa69a1eaa (patch)
treed7e89d4d2d749a55cd7c8e1c6461a6358f989c9e /unix/tclUnixNotfy.c
parent728b709f10ce32b2a8786f9402b734b061c01b8b (diff)
downloadtcl-19d37cea3398c5d08431fc9346d9dc7aa69a1eaa.zip
tcl-19d37cea3398c5d08431fc9346d9dc7aa69a1eaa.tar.gz
tcl-19d37cea3398c5d08431fc9346d9dc7aa69a1eaa.tar.bz2
* unix/Makefile.in: purify has to use -best-effort to instrument
* unix/tclUnixPipe.c: fixed mem leak in TclpCreateProcess when doing alloc between vfork and execvp. * unix/tclUnixTest.c: fixed mem leak in findexecutable test command * unix/tclUnixNotfy.c: fixed event/io threading problems by making triggerPipe non-blocking FossilOrigin-Name: 07e490e23d760249c9356de7656ede4f6e882c6f
Diffstat (limited to 'unix/tclUnixNotfy.c')
-rw-r--r--unix/tclUnixNotfy.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c
index 4053e4a..0600f81 100644
--- a/unix/tclUnixNotfy.c
+++ b/unix/tclUnixNotfy.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: tclUnixNotfy.c,v 1.5 1999/07/02 06:05:34 welch Exp $
+ * RCS: @(#) $Id: tclUnixNotfy.c,v 1.5.4.1 1999/10/30 11:09:45 hobbs Exp $
*/
#include "tclInt.h"
@@ -719,15 +719,12 @@ Tcl_WaitForEvent(timePtr)
waitingListPtr = tsdPtr;
tsdPtr->onList = 1;
- Tcl_MutexUnlock(&notifierMutex);
write(triggerPipe, "", 1);
- Tcl_MutexLock(&notifierMutex);
}
memset((VOID *) tsdPtr->readyMasks, 0, 3*MASK_SIZE*sizeof(fd_mask));
if (!tsdPtr->eventReady) {
-
Tcl_ConditionWait(&tsdPtr->waitCV, &notifierMutex, timePtr);
}
tsdPtr->eventReady = 0;
@@ -750,10 +747,7 @@ Tcl_WaitForEvent(timePtr)
}
tsdPtr->nextPtr = tsdPtr->prevPtr = NULL;
tsdPtr->onList = 0;
- Tcl_MutexUnlock(&notifierMutex);
write(triggerPipe, "", 1);
- Tcl_MutexLock(&notifierMutex);
-
}
@@ -870,10 +864,18 @@ NotifierThreadProc(clientData)
if (fcntl(receivePipe, F_SETFL, status) < 0) {
panic("NotifierThreadProc: could not make receive pipe non blocking.");
}
+ status = fcntl(fds[1], F_GETFL);
+ status |= O_NONBLOCK;
+ if (fcntl(fds[1], F_SETFL, status) < 0) {
+ panic("NotifierThreadProc: could not make trigger pipe non blocking.");
+ }
#else
if (ioctl(receivePipe, (int) FIONBIO, &status) < 0) {
panic("NotifierThreadProc: could not make receive pipe non blocking.");
}
+ if (ioctl(fds[1], (int) FIONBIO, &status) < 0) {
+ panic("NotifierThreadProc: could not make trigger pipe non blocking.");
+ }
#endif
/*