mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-30 12:04:07 +00:00
If destroying a spinlock, make sure that it is exited properly.
Submitted by: jhb MFC After: 3 days
This commit is contained in:
parent
ce036f4091
commit
861a23087b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=154103
@ -883,6 +883,10 @@ mtx_destroy(struct mtx *m)
|
||||
else {
|
||||
MPASS((m->mtx_lock & (MTX_RECURSED|MTX_CONTESTED)) == 0);
|
||||
|
||||
/* Perform the non-mtx related part of mtx_unlock_spin(). */
|
||||
if (LO_CLASSINDEX(&m->mtx_object) == LOCK_CLASS_SPIN_MUTEX)
|
||||
spinlock_exit();
|
||||
|
||||
/* Tell witness this isn't locked to make it happy. */
|
||||
WITNESS_UNLOCK(&m->mtx_object, LOP_EXCLUSIVE, __FILE__,
|
||||
__LINE__);
|
||||
|
Loading…
Reference in New Issue
Block a user