Date: Thu, 30 Mar 2006 15:49:22 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 94303 for review Message-ID: <200603301549.k2UFnMDO048195@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=94303 Change 94303 by jhb@jhb_slimer on 2006/03/30 15:48:24 Add an sx_xlocked() macro. Grrr. Affected files ... .. //depot/projects/smpng/sys/sys/sx.h#17 edit Differences ... ==== //depot/projects/smpng/sys/sys/sx.h#17 (text+ko) ==== @@ -76,6 +76,7 @@ SYSUNINIT(name##_sx_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ sx_destroy, (sxa)) +#define sx_xlocked(sx) ((sx)->sx_cnt < 0 && (sx)->sx_xholder == curthread) #define sx_slock(sx) _sx_slock((sx), LOCK_FILE, LOCK_LINE) #define sx_xlock(sx) _sx_xlock((sx), LOCK_FILE, LOCK_LINE) #define sx_try_slock(sx) _sx_try_slock((sx), LOCK_FILE, LOCK_LINE) @@ -86,7 +87,7 @@ #define sx_downgrade(sx) _sx_downgrade((sx), LOCK_FILE, LOCK_LINE) #define sx_unlock(sx) \ do { \ - if ((sx)->sx_cnt < 0) \ + if (sx_xlocked(sx)) \ sx_xunlock(sx); \ else \ sx_sunlock(sx); \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603301549.k2UFnMDO048195>