Check both seconds and nanoseconds are zero, only checking nanoseconds
is zero may trigger timeout too early. It seems a copy&paste bug.
This commit is contained in:
parent
7dc0ace10e
commit
879d152454
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=231906
@ -205,7 +205,7 @@ _thr_umtx_timedwait_uint(volatile u_int *mtx, u_int id, int clockid,
|
||||
if (abstime != NULL) {
|
||||
clock_gettime(clockid, &ts);
|
||||
TIMESPEC_SUB(&ts2, abstime, &ts);
|
||||
if (ts2.tv_sec < 0 || ts2.tv_nsec <= 0)
|
||||
if (ts2.tv_sec < 0 || (ts2.tv_sec == 0 && ts2.tv_nsec <= 0))
|
||||
return (ETIMEDOUT);
|
||||
tsp = &ts2;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user