From owner-p4-projects Wed Feb 26 12:10:10 2003 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6921637B413; Wed, 26 Feb 2003 12:10:08 -0800 (PST) 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 F3AE737B405 for ; Wed, 26 Feb 2003 12:10:07 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9D80543FDD for ; Wed, 26 Feb 2003 12:10:07 -0800 (PST) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h1QKA70U006783 for ; Wed, 26 Feb 2003 12:10:07 -0800 (PST) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h1QKA7WV006780 for perforce@freebsd.org; Wed, 26 Feb 2003 12:10:07 -0800 (PST) Date: Wed, 26 Feb 2003 12:10:07 -0800 (PST) Message-Id: <200302262010.h1QKA7WV006780@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin Subject: PERFORCE change 25942 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://perforce.freebsd.org/chv.cgi?CH=25942 Change 25942 by jhb@jhb_laptop on 2003/02/26 12:09:37 Inline mtx_trylock() when there is no debugging. It's even shorter than inlining mtx_lock() in that case. Affected files ... .. //depot/projects/smpng/sys/sys/mutex.h#31 edit Differences ... ==== //depot/projects/smpng/sys/sys/mutex.h#31 (text+ko) ==== @@ -254,6 +254,8 @@ _mtx_lock_flags((m), (opts), LOCK_FILE, LOCK_LINE) #define mtx_unlock_flags(m, opts) \ _mtx_unlock_flags((m), (opts), LOCK_FILE, LOCK_LINE) +#define mtx_trylock_flags(m, opts) \ + _mtx_trylock((m), (opts), LOCK_FILE, LOCK_LINE) #define mtx_lock_spin_flags(m, opts) \ _mtx_lock_spin_flags((m), (opts), LOCK_FILE, LOCK_LINE) #define mtx_unlock_spin_flags(m, opts) \ @@ -263,6 +265,8 @@ _get_sleep_lock((m), curthread, (opts), LOCK_FILE, LOCK_LINE) #define mtx_unlock_flags(m, opts) \ _rel_sleep_lock((m), curthread, (opts), LOCK_FILE, LOCK_LINE) +#define mtx_trylock_flags(m, opts) \ + (_obtain_lock((m), curthread)) #ifndef SMPnotyet #define mtx_lock_spin_flags(m, opts) \ _get_spin_lock((m), curthread, (opts), LOCK_FILE, LOCK_LINE) @@ -274,9 +278,6 @@ #endif /* SMP */ #endif /* LOCK_DEBUG */ -#define mtx_trylock_flags(m, opts) \ - _mtx_trylock((m), (opts), LOCK_FILE, LOCK_LINE) - #define mtx_initialized(m) ((m)->mtx_object.lo_flags & LO_INITIALIZED) #define mtx_owned(m) (((m)->mtx_lock & MTX_FLAGMASK) == (uintptr_t)curthread) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message