diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2015-08-31 10:41:22 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2015-08-31 10:41:22 (GMT) |
commit | d798be3eaf55726dfd1259cb8f285cecff5ad39c (patch) | |
tree | c00c8e4ed596c500e03ca46811d7fe010bbc8916 /unix/tclUnixNotfy.c | |
parent | 4e778d0112fb867161ef4b24103c493e73ce757b (diff) | |
parent | 573f9fd80810dede88587f8ec61fb5cbb4a100b8 (diff) | |
download | tcl-d798be3eaf55726dfd1259cb8f285cecff5ad39c.zip tcl-d798be3eaf55726dfd1259cb8f285cecff5ad39c.tar.gz tcl-d798be3eaf55726dfd1259cb8f285cecff5ad39c.tar.bz2 |
Merge trunk.
Add Gustaf's latest fix for unit-tests.
Diffstat (limited to 'unix/tclUnixNotfy.c')
-rw-r--r-- | unix/tclUnixNotfy.c | 13 |
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(¬ifierMutex); } #else - pthread_cond_wait(&tsdPtr->waitCV, ¬ifierMutex); + 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, ¬ifierMutex, &ptime); + } else { + pthread_cond_wait(&tsdPtr->waitCV, ¬ifierMutex); + } #endif /* __CYGWIN__ */ } tsdPtr->eventReady = 0; |