Skip to content

Commit

Permalink
Polish ::schedule_execution() a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
ryoqun committed Dec 18, 2023
1 parent 3aa988a commit d4acb29
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions unified-scheduler-pool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,20 +268,22 @@ impl<TH: TaskHandler> InstalledScheduler for PooledScheduler<TH> {

fn schedule_execution(&self, &(transaction, index): &(&SanitizedTransaction, usize)) {
let (result, timings) = &mut *self.result_with_timings.lock().expect("not poisoned");
if result.is_err() {
// just bail out early to short-circuit the processing altogether
return;
}

// ... so, we're NOT scheduling at all here; rather, just execute tx straight off. the
// inter-tx locking deps aren't needed to be resolved in the case of single-threaded FIFO
// like this.
if result.is_ok() {
TH::handle(
result,
timings,
self.context().bank(),
transaction,
index,
&self.inner.pool.handler_context,
);
}
TH::handle(
result,
timings,
self.context().bank(),
transaction,
index,
&self.inner.pool.handler_context,
);
}

fn wait_for_termination(
Expand Down

0 comments on commit d4acb29

Please sign in to comment.