mirror of
https://github.com/salsa-rs/salsa.git
synced 2024-11-29 02:59:08 +00:00
improve comment
This commit is contained in:
parent
346ce6bc16
commit
d4f7e4b2b4
1 changed files with 9 additions and 2 deletions
11
src/input.rs
11
src/input.rs
|
@ -144,14 +144,21 @@ where
|
||||||
durability
|
durability
|
||||||
);
|
);
|
||||||
|
|
||||||
// The value is changing, so even if we are setting this to a
|
// The value is changing, so we need a new revision (*). We also
|
||||||
// constant, we still need a new revision.
|
// need to update the 'last changed' revision by invoking
|
||||||
|
// `guard.mark_durability_as_changed`.
|
||||||
//
|
//
|
||||||
// CAREFUL: This will block until the global revision lock can
|
// CAREFUL: This will block until the global revision lock can
|
||||||
// be acquired. If there are still queries executing, they may
|
// be acquired. If there are still queries executing, they may
|
||||||
// need to read from this input. Therefore, we wait to acquire
|
// need to read from this input. Therefore, we wait to acquire
|
||||||
// the lock on `map` until we also hold the global query write
|
// the lock on `map` until we also hold the global query write
|
||||||
// lock.
|
// lock.
|
||||||
|
//
|
||||||
|
// (*) Technically, since you can't presently access an input
|
||||||
|
// for a non-existent key, and you can't enumerate the set of
|
||||||
|
// keys, we only need a new revision if the key used to
|
||||||
|
// exist. But we may add such methods in the future and this
|
||||||
|
// case doesn't generally seem worth optimizing for.
|
||||||
db.salsa_runtime().with_incremented_revision(|guard| {
|
db.salsa_runtime().with_incremented_revision(|guard| {
|
||||||
let mut slots = self.slots.write();
|
let mut slots = self.slots.write();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue