summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixNotfy.c
diff options
context:
space:
mode:
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