INNER CODE UNIT · Rust
get_num_threads_os
mratsim/constantine · constantine-rust/constantine-core/src/lib.rs:32
pub fn get_num_threads_os() -> usize {
unsafe { ctt_cpu_get_num_threads_os() }.try_into().unwrap()
}
}
// Threadpool
// ------------------------------------------------------------
#[derive(Debug)]
pub struct Threadpool {
ctx: *mut ctt_threadpool,
}
impl Threadpool {
/// Instantiate a new Threadpool with `num_threads` threads.
/// A single threadpool can be active on a given thread.
/// A new threadpool may be instantiated if the previous one has been shutdown.
#[inline(always)]