Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit 821dee2

Browse files
committed
Add justification of closure in create_task
1 parent be1bc6c commit 821dee2

File tree

1 file changed

+6
-0
lines changed
  • unified-scheduler-logic/src

1 file changed

+6
-0
lines changed

unified-scheduler-logic/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,12 @@ impl SchedulingStateMachine {
668668
/// implementation of [`Page`] look-up by [`pubkey`](Pubkey) to callers. It's the caller's
669669
/// responsibility to ensure the same instance is returned from the closure, given a particular
670670
/// pubkey.
671+
///
672+
/// Closure is used here to delegate the responsibility of general ownership of `Page` (and
673+
/// caching/pruning if any) to the caller. `SchedulingStateMachine` guarantees that all of
674+
/// shared owndership of `Page`s are released and Page state is identical to just after
675+
/// created, if `has_no_active_task()` is `true`. Also note that this is desired for separation
676+
/// of concern.
671677
pub fn create_task(
672678
transaction: SanitizedTransaction,
673679
index: usize,

0 commit comments

Comments
 (0)