rust: Name the Rayon threads

This commit is contained in:
Jack Grigg 2023-05-17 16:55:11 +00:00 committed by Carter Jernigan
parent bc19797125
commit dd7370cfcb
3 changed files with 11 additions and 1 deletions

View File

@ -2391,6 +2391,7 @@ dependencies = [
"log-panics",
"orchard",
"paranoid-android",
"rayon",
"schemer",
"secp256k1",
"secrecy",

View File

@ -26,6 +26,9 @@ zcash_primitives = "0.11"
zcash_proofs = "0.11"
orchard = { version = "0.4", default-features = false }
# Initialization
rayon = "1.7"
# Logging
log-panics = "2.0.0"
paranoid-android = "0.2"

View File

@ -126,7 +126,13 @@ pub unsafe extern "C" fn Java_cash_z_ecc_android_sdk_internal_jni_RustBackend_in
error!("Failed to reload tracing subscriber with NDK APIs: {}", e);
}
debug!("logs have been initialized successfully");
// Manually build the Rayon thread pool, so we can name the threads.
rayon::ThreadPoolBuilder::new()
.thread_name(|i| format!("zc-rayon-{}", i))
.build_global()
.expect("Only initialized once");
debug!("Rust backend has been initialized successfully");
print_debug_state();
}