summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2017-03-16 08:35:27 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2017-03-16 08:35:27 +0000
commit3fa5bfc6d6796ae17c0f5480cf506a3aa529d475 (patch)
tree6929169313f34aae5c153d46fae3370cc93d4d89
parent9a24f95dc98fadd71bfe155fd2e3b024307124e1 (diff)
Notes
-rw-r--r--sys/kern/kern_mutex.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c
index 7e581ff687e1..ed9dfbbb7258 100644
--- a/sys/kern/kern_mutex.c
+++ b/sys/kern/kern_mutex.c
@@ -211,10 +211,13 @@ unlock_spin(struct lock_object *lock)
int
owner_mtx(const struct lock_object *lock, struct thread **owner)
{
- const struct mtx *m = (const struct mtx *)lock;
+ const struct mtx *m;
+ uintptr_t x;
- *owner = mtx_owner(m);
- return (mtx_unowned(m) == 0);
+ m = (const struct mtx *)lock;
+ x = m->mtx_lock;
+ *owner = (struct thread *)(x & ~MTX_FLAGMASK);
+ return (x != MTX_UNOWNED);
}
#endif