Fix absolute to relative timeout computation. ok jsg@, mpi@

This commit is contained in:
matthieu 2020-02-04 18:40:21 +00:00
parent 363365145d
commit 514c5b7b09

View File

@ -99,7 +99,7 @@ static inline int futex_wait(uint32_t *addr, int32_t value, const struct timespe
{
struct timespec tsrel, tsnow;
clock_gettime(CLOCK_MONOTONIC, &tsnow);
timespecsub(timeout, &tsrel, &tsrel);
timespecsub(timeout, &tsnow, &tsrel);
return futex(addr, FUTEX_WAIT, value, &tsrel, NULL);
}