Skip to content

Commit 6477973

Browse files
committed
internal: fix deadlock introduced by #16643
1 parent 1214404 commit 6477973

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

crates/salsa/src/derived.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,14 @@ where
146146
revision: Revision,
147147
) -> bool {
148148
debug_assert!(revision < db.salsa_runtime().current_revision());
149-
let read = &self.slot_map.read();
149+
let read = self.slot_map.read();
150150
let Some((key, slot)) = read.get_index(index as usize) else {
151151
return false;
152152
};
153-
slot.maybe_changed_after(db, revision, key)
153+
let (key, slot) = (key.clone(), slot.clone());
154+
// note: this drop is load-bearing. removing it would causes deadlocks.
155+
drop(read);
156+
slot.maybe_changed_after(db, revision, &key)
154157
}
155158

156159
fn fetch(&self, db: &<Q as QueryDb<'_>>::DynDb, key: &Q::Key) -> Q::Value {

0 commit comments

Comments
 (0)