From owner-svn-src-head@FreeBSD.ORG Sun Feb 19 08:17:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31AC2106564A; Sun, 19 Feb 2012 08:17:15 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 211868FC1A; Sun, 19 Feb 2012 08:17:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1J8HES4071392; Sun, 19 Feb 2012 08:17:14 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1J8HEm1071390; Sun, 19 Feb 2012 08:17:14 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201202190817.q1J8HEm1071390@svn.freebsd.org> From: David Xu Date: Sun, 19 Feb 2012 08:17:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231906 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Feb 2012 08:17:15 -0000 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 {