summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixNotfy.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2015-08-31 10:41:22 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2015-08-31 10:41:22 (GMT)
commitb13ad887186f6e841d696f4b08dc53f9a2aab8a4 (patch)
treec00c8e4ed596c500e03ca46811d7fe010bbc8916 /unix/tclUnixNotfy.c
parent6e584734274ae6286fa7bdf4b14667b673ea68a0 (diff)
parentcdee0fcd74077f3208f3957e267a611192df1af1 (diff)
downloadtcl-b13ad887186f6e841d696f4b08dc53f9a2aab8a4.zip
tcl-b13ad887186f6e841d696f4b08dc53f9a2aab8a4.tar.gz
tcl-b13ad887186f6e841d696f4b08dc53f9a2aab8a4.tar.bz2
Merge trunk.
Add Gustaf's latest fix for unit-tests.
Diffstat (limited to 'unix/tclUnixNotfy.c')
-rw-r--r--unix/tclUnixNotfy.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c
index 0493ee4..693eeac 100644
--- a/unix/tclUnixNotfy.c
+++ b/unix/tclUnixNotfy.c
@@ -1032,7 +1032,18 @@ Tcl_WaitForEvent(
pthread_mutex_lock(&notifierMutex);
}
#else
- pthread_cond_wait(&tsdPtr->waitCV, &notifierMutex);
+ if (timePtr != NULL) {
+ Tcl_Time now;
+ struct timespec ptime;
+
+ Tcl_GetTime(&now);
+ ptime.tv_sec = timePtr->sec + now.sec + (timePtr->usec + now.usec) / 1000000;
+ ptime.tv_nsec = 1000 * ((timePtr->usec + now.usec) % 1000000);
+
+ pthread_cond_timedwait(&tsdPtr->waitCV, &notifierMutex, &ptime);
+ } else {
+ pthread_cond_wait(&tsdPtr->waitCV, &notifierMutex);
+ }
#endif /* __CYGWIN__ */
}
tsdPtr->eventReady = 0;