1#![deny(unsafe_op_in_unsafe_fn)]
18
19#[cfg(panic = "abort")]
20const _: () = {
21 compile_error!("vthread-stack requires panic=unwind");
22};
23
24#[cfg(not(any(
25 all(target_os = "linux", target_arch = "x86_64"),
26 all(target_os = "macos", target_arch = "aarch64"),
27)))]
28const _: () = {
29 compile_error!("vthread-stack supports Linux x86_64 and macOS ARM64");
30};
31
32mod arch;
33mod context;
34mod engine;
35mod entry;
36mod fiber;
37mod lease;
38mod mount;
39#[doc(hidden)]
40pub mod panic_payload;
41mod pool;
42mod scoped;
43mod stack;
44mod stack_unix;
45mod suspension;
46
47pub use fiber::Fiber;
48pub use lease::FiberLease;
49pub use mount::suspend;
50#[doc(hidden)]
51pub use mount::{ContextKey, check_suspend};
52pub use pool::{StackPool, StackPoolSnapshot};
53pub use scoped::{FiberScope, fiber_scope};
54pub use stack::{MappedStack, STACK_ALIGNMENT};
55pub use suspension::{FiberState, ParkRequest, ParkToken, Resume, SuspendError, Suspension};
56
57#[cfg(test)]
58#[path = "lib_test.rs"]
59mod lib_test;
60#[cfg(test)]
61#[path = "terminal_test.rs"]
62mod terminal_test;
63#[cfg(test)]
64#[path = "trace_test.rs"]
65mod trace_test;