Comments clarifying non-emptiness of threadset (#35388)

This commit is contained in:
Andrew Fitzgerald 2024-03-01 11:18:42 -08:00 committed by GitHub
parent 532b806bef
commit ede9163633
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -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>],

View File

@ -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,