diff options
author | davidxu <davidxu@FreeBSD.org> | 2012-02-19 08:17:14 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2012-02-19 08:17:14 +0000 |
commit | 828ee5105e23bffc5707561a80870ca6b1830611 (patch) | |
tree | ea7630de93c4928eedfa37f52b95d45b5fdda811 /lib/libthr | |
parent | d95361325278aa7213cc76aa3ea58d04f13bf305 (diff) | |
download | FreeBSD-src-828ee5105e23bffc5707561a80870ca6b1830611.zip FreeBSD-src-828ee5105e23bffc5707561a80870ca6b1830611.tar.gz |
Check both seconds and nanoseconds are zero, only checking nanoseconds
is zero may trigger timeout too early. It seems a copy&paste bug.
Diffstat (limited to 'lib/libthr')
-rw-r--r-- | lib/libthr/thread/thr_umtx.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libthr/thread/thr_umtx.c b/lib/libthr/thread/thr_umtx.c index e962378..0a8f861 100644 --- a/lib/libthr/thread/thr_umtx.c +++ b/lib/libthr/thread/thr_umtx.c @@ -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 { |