mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Use a consistent snapshot of the lock state in owner_mtx().
MFC after: 2 weeks
This commit is contained in:
parent
c365a2934e
commit
02315a6759
1 changed files with 6 additions and 3 deletions
|
|
@ -249,10 +249,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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue