#![no_std]
#![cfg_attr(feature = "shuttle", allow(dead_code))]
#![cfg_attr(feature = "shuttle", allow(unused_imports))]
extern crate alloc;
extern crate std;
mod blocker;
mod job;
mod scope;
mod signal;
mod thread_pool;
mod unwind;
pub use scope::Scope;
pub use thread_pool::ThreadPool;
pub use thread_pool::Worker;
pub use thread_pool::Yield;
pub use thread_pool::block_on;
pub use thread_pool::join;
pub use thread_pool::scope;
pub use thread_pool::spawn;
pub use thread_pool::spawn_async;
pub use thread_pool::spawn_future;
#[cfg(not(feature = "shuttle"))]
mod platform {
pub use alloc::sync::Arc;
pub use alloc::sync::Weak;
pub use core::sync::atomic::AtomicBool;
pub use core::sync::atomic::AtomicU32;
pub use core::sync::atomic::Ordering;
pub use std::sync::Barrier;
pub use std::sync::Condvar;
pub use std::sync::Mutex;
pub use std::thread::Builder as ThreadBuilder;
pub use std::thread::JoinHandle;
pub use std::thread::available_parallelism;
pub use std::thread_local;
}
#[cfg(feature = "shuttle")]
mod platform {
pub use shuttle::sync::Arc;
pub use shuttle::sync::Barrier;
pub use shuttle::sync::Condvar;
pub use shuttle::sync::Mutex;
pub use shuttle::sync::Weak;
pub use shuttle::sync::atomic::AtomicBool;
pub use shuttle::sync::atomic::AtomicU32;
pub use shuttle::sync::atomic::Ordering;
pub use shuttle::thread::Builder as ThreadBuilder;
pub use shuttle::thread::JoinHandle;
pub use shuttle::thread_local;
pub fn available_parallelism() -> std::io::Result<core::num::NonZero<usize>> {
panic!("available_parallelism does not work on shuttle");
}
}