Skip to main content

thread

Macro thread 

Source
macro_rules! thread {
    ($name:expr, $entry:expr, $prio:expr, $stack:expr) => { ... };
}
Expand description

Create a crate::JoinHandle for a thread that works in both heap and zero-heap modes.

Uses the safe fn() entry pattern (no StopToken). The name is automatically null-terminated. In zero-heap mode the storage is emitted as a static $crate::ThreadStorage<$stack> and passed by reference to [crate::Builder::spawn_static_simple] — no static mut, no addr_of_mut!, no unsafe in user-visible expansion.

§Example

let h = ove::thread!("worker", my_entry, Priority::Normal, 4096);
h.detach();  // fire-and-forget; or store in InitCell<JoinHandle<()>>.