pthread: limit timeouts to >= 10 ms

The timed semaphore supports a minimum timeout of 10 ms and logs a
warning if the timeout is lower than the minimum. To prevent the
warning, we limit timeouts to >= 10 ms.
This commit is contained in:
Christian Helmuth 2013-09-02 14:58:49 +02:00
parent 5d9b563503
commit a11a17147f

View File

@ -501,6 +501,12 @@ extern "C" {
if (abstime_ms > currtime_ms)
timeout = abstime_ms - currtime_ms;
try {
/*
* The timed semaphore supports a timeout minimum of 10 ms and
* logs a warning if the timeout is lower than the minimum. To
* prevent the warning, limit timeouts to >= 10 ms here.
*/
if (timeout != 0) timeout = max(timeout, 10);
c->signal_sem.down(timeout);
} catch (Timeout_exception) {
result = ETIMEDOUT;