Date: Sat, 3 Jun 2006 21:19:51 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 98428 for review Message-ID: <200606032119.k53LJp7P094371@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=98428 Change 98428 by jhb@jhb_mutex on 2006/06/03 21:19:49 Duplicate last fix to CVS. Affected files ... .. //depot/projects/smpng/sys/kern/kern_mutex.c#127 edit .. //depot/projects/smpng/sys/sys/mutex.h#62 edit Differences ... ==== //depot/projects/smpng/sys/kern/kern_mutex.c#127 (text+ko) ==== @@ -91,7 +91,7 @@ */ #define mtx_unowned(m) ((m)->mtx_lock == MTX_UNOWNED) -#define mtx_owner(m) ((struct thread *)((m)->mtx_lock & (MTX_FLAGMASK|MTX_UNOWNED))) +#define mtx_owner(m) ((struct thread *)((m)->mtx_lock & ~MTX_FLAGMASK)) #ifdef DDB static void db_show_mtx(struct lock_object *lock); @@ -542,7 +542,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#62 (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 | MTX_UNOWNED) #endif /* _KERNEL */ @@ -322,7 +322,7 @@ #define mtx_initialized(m) lock_initalized(&(m)->mtx_object) -#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?200606032119.k53LJp7P094371>