Skip to content

Commit

Permalink
Comments clarifying non-emptiness of threadset (#35388)
Browse files Browse the repository at this point in the history
  • Loading branch information
apfitzge authored Mar 1, 2024
1 parent 532b806 commit ede9163
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ impl PrioGraphScheduler {
/// If the `chain_thread` is available, this thread will be selected, regardless of
/// load-balancing.
///
/// Panics if the `thread_set` is empty.
/// Panics if the `thread_set` is empty. This should never happen, see comment
/// on `ThreadAwareAccountLocks::try_lock_accounts`.
fn select_thread(
thread_set: ThreadSet,
batches_per_thread: &[Vec<SanitizedTransaction>],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ impl ThreadAwareAccountLocks {
/// `allowed_threads` is a set of threads that the caller restricts locking to.
/// If accounts are schedulable, then they are locked for the thread
/// selected by the `thread_selector` function.
/// `thread_selector` is only called if all accounts are schdulable, meaning
/// that the `thread_set` passed to `thread_selector` is non-empty.
pub(crate) fn try_lock_accounts<'a>(
&mut self,
write_account_locks: impl Iterator<Item = &'a Pubkey> + Clone,
Expand Down

0 comments on commit ede9163

Please sign in to comment.