Date: Wed, 26 Feb 2003 12:10:07 -0800 (PST) From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 25942 for review Message-ID: <200302262010.h1QKA7WV006780@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200302262010.h1QKA7WV006780>