Distribute tasks among all the CPUs

This commit is contained in:
Zejun Zhao
2025-01-13 16:39:47 +08:00
committed by Tate, Hongliang Tian
parent d74d126e64
commit 29791ba77e
6 changed files with 47 additions and 23 deletions

View File

@ -48,6 +48,11 @@ impl AtomicCpuId {
.map_err(|prev| (prev as usize).try_into().unwrap())
}
/// Sets the inner value of an `AtomicCpuId` anyway.
pub fn set_anyway(&self, cpu_id: CpuId) {
self.0.store(cpu_id.as_usize() as u32, Ordering::Relaxed);
}
/// Sets the inner value of an `AtomicCpuId` to `AtomicCpuId::NONE`, i.e. makes
/// an `AtomicCpuId` empty.
pub fn set_to_none(&self) {