From owner-p4-projects@FreeBSD.ORG Sat Apr 15 01:42:47 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BCABD16A402; Sat, 15 Apr 2006 01:42:47 +0000 (UTC) X-Original-To: perforce@freebsd.org 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 8331A16A400 for ; Sat, 15 Apr 2006 01:42:47 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5132043D45 for ; Sat, 15 Apr 2006 01:42:47 +0000 (GMT) (envelope-from jb@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 k3F1glmv089034 for ; Sat, 15 Apr 2006 01:42:47 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k3F1glwQ089031 for perforce@freebsd.org; Sat, 15 Apr 2006 01:42:47 GMT (envelope-from jb@freebsd.org) Date: Sat, 15 Apr 2006 01:42:47 GMT Message-Id: <200604150142.k3F1glwQ089031@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 95298 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2006 01:42:48 -0000 http://perforce.freebsd.org/chv.cgi?CH=95298 Change 95298 by jb@jb_freebsd2 on 2006/04/15 01:42:13 Add an inline definition for pthread_cond_reltimedwait_np(). Affected files ... .. //depot/projects/dtrace/src/contrib/opensolaris/compat/thread.h#3 edit Differences ... ==== //depot/projects/dtrace/src/contrib/opensolaris/compat/thread.h#3 (text+ko) ==== @@ -54,4 +54,23 @@ #define RW_WRITE_HELD(_a) pthread_rwlock_wrheld_np(_a) #define RW_LOCK_HELD(x) (RW_READ_HELD(x) || RW_WRITE_HELD(x)) +#define timespecadd(vvp, uvp) \ + do { \ + (vvp)->tv_sec += (uvp)->tv_sec; \ + (vvp)->tv_nsec += (uvp)->tv_nsec; \ + if ((vvp)->tv_nsec >= 1000000000) { \ + (vvp)->tv_sec++; \ + (vvp)->tv_nsec -= 1000000000; \ + } \ + } while (0) + +static __inline int pthread_cond_reltimedwait_np(pthread_cond_t *cvp, + pthread_mutex_t *mp, const struct timespec *reltime) +{ + struct timespec ts; + clock_gettime(CLOCK_REALTIME,&ts); + timespecadd(&ts,reltime); + return(pthread_cond_timedwait(cvp, mp, &ts)); +} + #endif