summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixNotfy.c
diff options
context:
space:
mode:
authordas <das@noemail.net>2006-08-21 01:08:08 (GMT)
committerdas <das@noemail.net>2006-08-21 01:08:08 (GMT)
commit7e65d45bd79745972b2c522ef3215c92aa908b44 (patch)
tree944a1205d51ac2cbc599ade273e50e17fa5d7372 /unix/tclUnixNotfy.c
parent4fc1dd2047cb3e5dd7f9b41dab19e6a45b107199 (diff)
downloadtcl-7e65d45bd79745972b2c522ef3215c92aa908b44.zip
tcl-7e65d45bd79745972b2c522ef3215c92aa908b44.tar.gz
tcl-7e65d45bd79745972b2c522ef3215c92aa908b44.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; sync panic msg changes from HEAD. * 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] FossilOrigin-Name: 346bc651f3e4c07a1c97c838af898668a554c104
Diffstat (limited to 'unix/tclUnixNotfy.c')
-rw-r--r--unix/tclUnixNotfy.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c
index 7488cf1..118fa79 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.11.2.14 2005/11/27 02:34:42 das Exp $
+ * RCS: @(#) $Id: tclUnixNotfy.c,v 1.11.2.15 2006/08/21 01:08:10 das Exp $
*/
#include "tclInt.h"
@@ -715,6 +715,16 @@ Tcl_WaitForEvent(timePtr)
waitForFiles = (tsdPtr->numFdBits > 0);
if (timePtr != NULL && timePtr->sec == 0 && timePtr->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]
+ */
+ || timePtr->usec < 10
+#endif
+ )) {
/*
* Cannot emulate a polling select with a polling condition variable.
* Instead, pretend to wait for files and tell the notifier