Add debug asserts to futex ReentrantMutex impl.
This commit is contained in:
parent
43651aa34f
commit
83e8b9e4dd
@ -215,6 +215,7 @@ impl ReentrantMutex {
|
|||||||
true
|
true
|
||||||
} else if self.mutex.try_lock() {
|
} else if self.mutex.try_lock() {
|
||||||
self.owner.store(this_thread, Relaxed);
|
self.owner.store(this_thread, Relaxed);
|
||||||
|
debug_assert_eq!(*self.lock_count.get(), 0);
|
||||||
*self.lock_count.get() = 1;
|
*self.lock_count.get() = 1;
|
||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
@ -229,6 +230,7 @@ impl ReentrantMutex {
|
|||||||
} else {
|
} else {
|
||||||
self.mutex.lock();
|
self.mutex.lock();
|
||||||
self.owner.store(this_thread, Relaxed);
|
self.owner.store(this_thread, Relaxed);
|
||||||
|
debug_assert_eq!(*self.lock_count.get(), 0);
|
||||||
*self.lock_count.get() = 1;
|
*self.lock_count.get() = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user