PERFORCE change 74209 for review
John Baldwin
jhb at FreeBSD.org
Thu Mar 31 13:02:30 PST 2005
http://perforce.freebsd.org/chv.cgi?CH=74209
Change 74209 by jhb at 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)
More information about the p4-projects
mailing list