From owner-p4-projects@FreeBSD.ORG Wed Feb 23 13:49:03 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BB26D16A4D0; Wed, 23 Feb 2005 13:49:02 +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 8DB4A16A4CE for ; Wed, 23 Feb 2005 13:49:02 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5848C43D31 for ; Wed, 23 Feb 2005 13:49:02 +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 j1NDn2AM057491 for ; Wed, 23 Feb 2005 13:49:02 GMT (envelope-from davidxu@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j1NDn2HW057488 for perforce@freebsd.org; Wed, 23 Feb 2005 13:49:02 GMT (envelope-from davidxu@freebsd.org) Date: Wed, 23 Feb 2005 13:49:02 GMT Message-Id: <200502231349.j1NDn2HW057488@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 71660 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: Wed, 23 Feb 2005 13:49:03 -0000 http://perforce.freebsd.org/chv.cgi?CH=71660 Change 71660 by davidxu@davidxu_alona on 2005/02/23 13:49:01 Some style fixes. Affected files ... .. //depot/projects/davidxu_thread/src/lib/libthread/thread/thr_cond.c#14 edit Differences ... ==== //depot/projects/davidxu_thread/src/lib/libthread/thread/thr_cond.c#14 (text+ko) ==== @@ -105,8 +105,9 @@ int _pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *cond_attr) { + *cond = NULL; - return cond_init(cond, cond_attr); + return (cond_init(cond, cond_attr)); } int @@ -257,7 +258,8 @@ int _pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) { - return cond_wait_common(cond, mutex, NULL, 0); + + return (cond_wait_common(cond, mutex, NULL, 0)); } __strong_reference(_pthread_cond_wait, _thr_cond_wait); @@ -265,18 +267,20 @@ int __pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) { - return cond_wait_common(cond, mutex, NULL, 1); + + return (cond_wait_common(cond, mutex, NULL, 1)); } int _pthread_cond_timedwait(pthread_cond_t * cond, pthread_mutex_t * mutex, const struct timespec * abstime) { + if (abstime == NULL || abstime->tv_sec < 0 || abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000) return (EINVAL); - return cond_wait_common(cond, mutex, abstime, 0); + return (cond_wait_common(cond, mutex, abstime, 0)); } __strong_reference(_pthread_cond_timedwait, _thr_cond_timedwait); @@ -285,11 +289,12 @@ __pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, const struct timespec *abstime) { + if (abstime == NULL || abstime->tv_sec < 0 || abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000) return (EINVAL); - return cond_wait_common(cond, mutex, abstime, 1); + return (cond_wait_common(cond, mutex, abstime, 1)); } static int @@ -330,7 +335,8 @@ int _pthread_cond_signal(pthread_cond_t * cond) { - return cond_signal_common(cond, 0); + + return (cond_signal_common(cond, 0)); } __strong_reference(_pthread_cond_signal, _thr_cond_signal); @@ -338,7 +344,8 @@ int _pthread_cond_broadcast(pthread_cond_t * cond) { - return cond_signal_common(cond, 1); + + return (cond_signal_common(cond, 1)); } __strong_reference(_pthread_cond_broadcast, _thr_cond_broadcast);