From owner-p4-projects@FreeBSD.ORG Sun Mar 20 13:51:30 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 442F916A4D0; Sun, 20 Mar 2005 13:51:30 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1DE0516A4CE for ; Sun, 20 Mar 2005 13:51:30 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 06E5B43D48 for ; Sun, 20 Mar 2005 13:51:30 +0000 (GMT) (envelope-from davidxu@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j2KDpTm4013398 for ; Sun, 20 Mar 2005 13:51:29 GMT (envelope-from davidxu@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j2KDpTNu013395 for perforce@freebsd.org; Sun, 20 Mar 2005 13:51:29 GMT (envelope-from davidxu@freebsd.org) Date: Sun, 20 Mar 2005 13:51:29 GMT Message-Id: <200503201351.j2KDpTNu013395@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to davidxu@freebsd.org using -f From: David Xu To: Perforce Change Reviews Subject: PERFORCE change 73586 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Mar 2005 13:51:31 -0000 http://perforce.freebsd.org/chv.cgi?CH=73586 Change 73586 by davidxu@davidxu_alona on 2005/03/20 13:50:40 Check timeout. Affected files ... .. //depot/projects/davidxu_thread/src/lib/libthread/thread/thr_umtx.c#3 edit Differences ... ==== //depot/projects/davidxu_thread/src/lib/libthread/thread/thr_umtx.c#3 (text+ko) ==== @@ -42,6 +42,9 @@ __thr_umtx_timedlock(volatile umtx_t *mtx, long id, const struct timespec *timeout) { + if (timeout && (timeout->tv_sec < 0 || (timeout->tv_sec == 0 && + timeout->tv_nsec <= 0))) + return (ETIMEDOUT); if (_umtx_op((struct umtx *)mtx, UMTX_OP_LOCK, id, 0, (void *)timeout) == 0) return (0); @@ -59,6 +62,9 @@ int _thr_umtx_wait(volatile umtx_t *mtx, long id, const struct timespec *timeout) { + if (timeout && (timeout->tv_sec < 0 || (timeout->tv_sec == 0 && + timeout->tv_nsec <= 0))) + return (ETIMEDOUT); if (_umtx_op((struct umtx *)mtx, UMTX_OP_WAIT, id, 0, (void*) timeout) == 0) return (0);