Date: Thu, 31 Mar 2005 21:02:29 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 74209 for review Message-ID: <200503312102.j2VL2TY1066895@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=74209 Change 74209 by jhb@jhb_slimer on 2005/03/31 21:01:38 Revert MTX_FLAGMASK changes (refix mtx_owned() since I hadn't updated it). Affected files ... .. //depot/projects/smpng/sys/kern/kern_mutex.c#96 edit .. //depot/projects/smpng/sys/sys/mutex.h#52 edit Differences ... ==== //depot/projects/smpng/sys/kern/kern_mutex.c#96 (text+ko) ==== @@ -89,7 +89,7 @@ #define mtx_unowned(m) ((m)->mtx_lock == MTX_UNOWNED) #define mtx_owner(m) (mtx_unowned((m)) ? NULL \ - : (struct thread *)((m)->mtx_lock & ~MTX_FLAGMASK)) + : (struct thread *)((m)->mtx_lock & MTX_FLAGMASK)) /* * Lock classes for sleep and spin mutexes. @@ -518,7 +518,7 @@ * If the current owner of the lock is executing on another * CPU, spin instead of blocking. */ - owner = (struct thread *)(v & ~MTX_FLAGMASK); + owner = (struct thread *)(v & MTX_FLAGMASK); #ifdef ADAPTIVE_GIANT if (TD_IS_RUNNING(owner)) { #else ==== //depot/projects/smpng/sys/sys/mutex.h#52 (text+ko) ==== @@ -71,7 +71,7 @@ #define MTX_RECURSED 0x00000001 /* lock recursed (for MTX_DEF only) */ #define MTX_CONTESTED 0x00000002 /* lock contested (for MTX_DEF only) */ #define MTX_UNOWNED 0x00000004 /* Cookie for free mutex */ -#define MTX_FLAGMASK (MTX_RECURSED | MTX_CONTESTED) +#define MTX_FLAGMASK ~(MTX_RECURSED | MTX_CONTESTED) #endif /* _KERNEL */ @@ -322,7 +322,7 @@ #define mtx_initialized(m) ((m)->mtx_object.lo_flags & LO_INITIALIZED) -#define mtx_owned(m) (((m)->mtx_lock & MTX_FLAGMASK) == (uintptr_t)curthread) +#define mtx_owned(m) (((m)->mtx_lock & ~MTX_FLAGMASK) == (uintptr_t)curthread) #define mtx_recursed(m) ((m)->mtx_recurse != 0)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200503312102.j2VL2TY1066895>