svn commit: r231906 - head/lib/libthr/thread

David Xu davidxu at FreeBSD.org
Sun Feb 19 08:17:15 UTC 2012


Author: davidxu
Date: Sun Feb 19 08:17:14 2012
New Revision: 231906
URL: http://svn.freebsd.org/changeset/base/231906

Log:
  Check both seconds and nanoseconds are zero, only checking nanoseconds
  is zero may trigger timeout too early. It seems a copy&paste bug.

Modified:
  head/lib/libthr/thread/thr_umtx.c

Modified: head/lib/libthr/thread/thr_umtx.c
==============================================================================
--- head/lib/libthr/thread/thr_umtx.c	Sun Feb 19 07:44:38 2012	(r231905)
+++ head/lib/libthr/thread/thr_umtx.c	Sun Feb 19 08:17:14 2012	(r231906)
@@ -205,7 +205,7 @@ _thr_umtx_timedwait_uint(volatile u_int 
 	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 {


More information about the svn-src-all mailing list