preemptive_threads/
lib.rs1#![no_std]
2
3pub mod atomic_scheduler;
4pub mod context;
5pub mod context_full;
6pub mod error;
7pub mod platform_timer;
8pub mod preemption;
9pub mod safe_api;
10pub mod scheduler;
11pub mod signal_safe;
12pub mod stack_guard;
13pub mod sync;
14pub mod thread;
15
16#[cfg(all(test, feature = "std"))]
17mod tests;
18
19#[cfg(test)]
20extern crate std;
21
22#[cfg(all(not(test), not(feature = "std")))]
23use core::panic::PanicInfo;
24
25#[cfg(all(not(test), not(feature = "std")))]
26#[panic_handler]
27fn panic(_info: &PanicInfo) -> ! {
28 loop {}
29}
30
31pub use atomic_scheduler::{AtomicScheduler, ATOMIC_SCHEDULER};
32pub use error::{ThreadError, ThreadResult};
33pub use platform_timer::{init_preemption_timer, stop_preemption_timer, preemption_checkpoint};
34pub use safe_api::{
35 exit_thread as safe_exit, yield_now, Mutex, MutexGuard, ThreadBuilder, ThreadHandle, ThreadPool,
36};
37pub use scheduler::{Scheduler, SCHEDULER};
38pub use stack_guard::{ProtectedStack, StackGuard, StackStats, StackStatus};
39pub use sync::{exit_thread, yield_thread};
40pub use thread::{Thread, ThreadId, ThreadState};