Threadpool2 (#15151)

* rework thread pool for hash calculation

* rename
This commit is contained in:
Jeff Washington (jwash)
2021-02-05 18:48:16 -06:00
committed by GitHub
parent 3a5c142a9b
commit fbf9dc47e9
4 changed files with 15 additions and 14 deletions

View File

@@ -927,7 +927,7 @@ pub fn bank_to_snapshot_archive<P: AsRef<Path>, Q: AsRef<Path>>(
snapshot_version: Option<SnapshotVersion>,
snapshot_package_output_path: Q,
archive_format: ArchiveFormat,
thread_pool: &ThreadPool,
thread_pool: Option<&ThreadPool>,
) -> Result<PathBuf> {
let snapshot_version = snapshot_version.unwrap_or_default();
@@ -954,7 +954,7 @@ pub fn bank_to_snapshot_archive<P: AsRef<Path>, Q: AsRef<Path>>(
None,
)?;
let package = process_accounts_package_pre(package, Some(&thread_pool));
let package = process_accounts_package_pre(package, thread_pool);
archive_snapshot_package(&package)?;
Ok(package.tar_output_file)
@@ -971,7 +971,7 @@ pub fn process_accounts_package_pre(
let (hash, lamports) = AccountsDB::calculate_accounts_hash_without_index(
&accounts_package.storages,
accounts_package.simple_capitalization_testing,
&thread_pool.unwrap(),
thread_pool,
);
assert_eq!(accounts_package.expected_capitalization, lamports);