We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 84f9155 commit f6d7984Copy full SHA for f6d7984
src/core/rbtree/tests.rs
@@ -546,6 +546,23 @@ fn qc_rbtree_interval_rw_lock_core(cmds: Vec<u8>) {
546
log::trace!("{:?}", reference_rwlock);
547
}
548
549
+ // Release completed locks. This will unblock and complete other locks
550
+ // in turn. After repeating this step, if there are still incomplete
551
+ // locks, that means our interval lock is prone to deadlocks.
552
+ while !locks.is_empty() {
553
+ let i = locks
554
+ .iter()
555
+ .cloned()
556
+ .position(|id| subject_rwlock.is_complete(id));
557
+
558
+ if let Some(i) = i {
559
+ let id = locks.swap_remove(i);
560
+ subject_rwlock.unlock(id);
561
+ } else {
562
+ panic!("deadlock");
563
+ }
564
565
566
None
567
})();
568
0 commit comments