refactor: align platform crate boundaries

This commit is contained in:
bfloat16 committed 2026-09-07 19:29:54 +08:00
1 parent aa1bcaa2eb
commit 6250ca4e98
43 files changed
+1004 -1004

No files matched your search

+9 -1
View File
@@ -10,5 +10,13 @@ pub use windows::{
/// Deterministic worker-thread cap shared by filesystem scanning and engines.
pub fn thread_cap() -> usize {
windows::thread_cap()
if let Ok(value) = std::env::var("SENBEI_THREADS")
&& let Ok(count) = value.trim().parse::<usize>()
&& count >= 1
{
return count;
}
std::thread::available_parallelism()
.map(|count| count.get())
.unwrap_or(1)
}