summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixNotfy.c
diff options
context:
space:
mode:
authordas <das>2006-08-21 01:08:03 (GMT)
committerdas <das>2006-08-21 01:08:03 (GMT)
commitd70383944a28777ea679b1e1b4be38c2a42b3960 (patch)
tree1444f5611d45b011b9c6802f90b77083be59435f /unix/tclUnixNotfy.c
parentc8aa816f783a31a2a7a3315813d563c83a73a5d1 (diff)
downloadtcl-d70383944a28777ea679b1e1b4be38c2a42b3960.zip
tcl-d70383944a28777ea679b1e1b4be38c2a42b3960.tar.gz
tcl-d70383944a28777ea679b1e1b4be38c2a42b3960.tar.bz2
* macosx/tclMacOSXNotify.c (Tcl_WaitForEvent): if the run loop is
already running (e.g. if Tcl_WaitForEvent was called recursively), re-run it in a custom run loop mode containing only the source for the notifier thread, otherwise wakeups from other sources added to the common run loop modes might get lost. * unix/tclUnixNotfy.c (Tcl_WaitForEvent): on 64-bit Darwin, pthread_cond_timedwait() appears to have a bug that causes it to wait forever when passed an absolute time which has already been exceeded by the system time; as a workaround, when given a very brief timeout, just do a poll on that platform. [Bug 1457797]
Diffstat (limited to 'unix/tclUnixNotfy.c')
-rw-r--r--unix/tclUnixNotfy.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c
index 0a405ce..2574015 100644
--- a/unix/tclUnixNotfy.c
+++ b/unix/tclUnixNotfy.c
@@ -10,7 +10,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.31 2006/08/10 12:15:32 dkf Exp $
+ * RCS: @(#) $Id: tclUnixNotfy.c,v 1.32 2006/08/21 01:08:03 das Exp $
*/
#include "tclInt.h"
@@ -740,7 +740,17 @@ Tcl_WaitForEvent(
Tcl_MutexLock(&notifierMutex);
waitForFiles = (tsdPtr->numFdBits > 0);
- if (myTimePtr != NULL && myTimePtr->sec == 0 && myTimePtr->usec == 0) {
+ if (myTimePtr != NULL && myTimePtr->sec == 0 && (myTimePtr->usec == 0
+#if defined(__APPLE__) && defined(__LP64__)
+ /*
+ * On 64-bit Darwin, pthread_cond_timedwait() appears to have a bug
+ * that causes it to wait forever when passed an absolute time which
+ * has already been exceeded by the system time; as a workaround,
+ * when given a very brief timeout, just do a poll. [Bug 1457797]
+ */
+ || myTimePtr->usec < 10
+#endif
+ )) {
/*
* Cannot emulate a polling select with a polling condition variable.
* Instead, pretend to wait for files and tell the notifier thread