Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Feb 2012 08:17:14 +0000 (UTC)
From:      David Xu <davidxu@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r231906 - head/lib/libthr/thread
Message-ID:  <201202190817.q1J8HEm1071390@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202190817.q1J8HEm1071390>