From owner-p4-projects@FreeBSD.ORG Thu Mar 30 15:49:23 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 A475D16A420; Thu, 30 Mar 2006 15:49:23 +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 4E3AD16A41F for ; Thu, 30 Mar 2006 15:49:23 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1D37043D49 for ; Thu, 30 Mar 2006 15:49:23 +0000 (GMT) (envelope-from jhb@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 k2UFnMTb048198 for ; Thu, 30 Mar 2006 15:49:22 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k2UFnMDO048195 for perforce@freebsd.org; Thu, 30 Mar 2006 15:49:22 GMT (envelope-from jhb@freebsd.org) Date: Thu, 30 Mar 2006 15:49:22 GMT Message-Id: <200603301549.k2UFnMDO048195@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 94303 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: Thu, 30 Mar 2006 15:49:23 -0000 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); \