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