Expand description
Kernel thread API (kthread).
Ergonomic wrapper over Task::new_kernel_task + add_task for spawning
closure-based kernel threads. Kernel threads stay internal: they never go
through /thread/* because SYS_THREAD_CREATE / /thread/create refuse
kernel parents by design.
ⓘ
let tid = kthread::spawn("gc-worker", || {
loop { /* ... */ kthread::yield_now(); }
})?;Functions§
- current_
task - Convenience: clone of the current task’s
Arc<Task>, if any. - current_
tid TaskIdof the calling kernel thread, if one is current.- kthread_
trampoline 🔒 - Trampoline for closure-based kernel threads.
- spawn
- Spawn a kernel thread running
f. - yield_
now - Cooperative yield for kernel threads.