From 828ee5105e23bffc5707561a80870ca6b1830611 Mon Sep 17 00:00:00 2001 From: davidxu Date: Sun, 19 Feb 2012 08:17:14 +0000 Subject: Check both seconds and nanoseconds are zero, only checking nanoseconds is zero may trigger timeout too early. It seems a copy&paste bug. --- lib/libthr/thread/thr_umtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libthr') 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 { -- cgit v1.1