summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixNotfy.c
diff options
context:
space:
mode:
authorhobbs <hobbs@noemail.net>1999-10-21 02:18:08 (GMT)
committerhobbs <hobbs@noemail.net>1999-10-21 02:18:08 (GMT)
commit22eea12fdbe4e79a3d4ded003908f4214214df7c (patch)
treef22ae8591ad52edd536293852749b44aa0567917 /unix/tclUnixNotfy.c
parent1bf1eab227dd850769cf2aea27fe046a381aaecb (diff)
downloadtcl-22eea12fdbe4e79a3d4ded003908f4214214df7c.zip
tcl-22eea12fdbe4e79a3d4ded003908f4214214df7c.tar.gz
tcl-22eea12fdbe4e79a3d4ded003908f4214214df7c.tar.bz2
* unix/tclUnixNotfy.c: fixed event/io threading problems by
making triggerPipe non-blocking FossilOrigin-Name: 43510a5f53245111960d776f53d4eca8e9a13f1c
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..d116f8a 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.6 1999/10/21 02:18:09 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
/*