diff options
author | jhb <jhb@FreeBSD.org> | 2006-06-03 21:11:33 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2006-06-03 21:11:33 +0000 |
commit | bdcca9d25ab3e9b4623ec20485ddf89e16a616f7 (patch) | |
tree | 90c4315ce032709aa7289d88b5a9e68f10ada59e /sys/sys/mutex.h | |
parent | 4cc73bae0eced8efc1bf68c57030ace45a486294 (diff) | |
download | FreeBSD-src-bdcca9d25ab3e9b4623ec20485ddf89e16a616f7.zip FreeBSD-src-bdcca9d25ab3e9b4623ec20485ddf89e16a616f7.tar.gz |
Bah, fix fat finger in last. Invert the ~ on MTX_FLAGMASK as it's
non-intuitive for the ~ to be built into the mask. All the users now
explicitly ~ the mask. In addition, add MTX_UNOWNED to the mask even
though it technically isn't a flag. This should unbreak mtx_owner().
Quickly spotted by: kris
Diffstat (limited to 'sys/sys/mutex.h')
-rw-r--r-- | sys/sys/mutex.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/sys/mutex.h b/sys/sys/mutex.h index 7984a25..a28ea31 100644 --- a/sys/sys/mutex.h +++ b/sys/sys/mutex.h @@ -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 @@ extern struct mtx_pool *mtxpool_sleep; #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) |