Message296896
The current code of PyThread_acquire_lock_timed() (the implementation not using semaphore) doesn't compute correctly the timeout when pthread_cond_timedwait() is interrupted by a signal. We should recompute the timeout using a deadline.
Something like select.select():
if (tvp)
deadline = _PyTime_GetMonotonicClock() + timeout;
do {
... use tvp
if (errno != EINTR)
break;
/* select() was interrupted by a signal */
if (PyErr_CheckSignals())
goto finally;
if (tvp) {
timeout = deadline - _PyTime_GetMonotonicClock();
if (timeout < 0) {
n = 0;
break;
}
_PyTime_AsTimeval_noraise(timeout, &tv, _PyTime_ROUND_CEILING);
/* retry select() with the recomputed timeout */
}
} while (1); |
|
Date |
User |
Action |
Args |
2017-06-26 13:50:01 | vstinner | set | recipients:
+ vstinner, pitrou, neologix |
2017-06-26 13:50:01 | vstinner | set | messageid: <1498485001.71.0.115721395457.issue30768@psf.upfronthosting.co.za> |
2017-06-26 13:50:01 | vstinner | link | issue30768 messages |
2017-06-26 13:50:01 | vstinner | create | |
|