MCPcopy Create free account
hub / github.com/Starry-OS/StarryOS / AsThread

Interface AsThread

core/src/task.rs:174–182  ·  view source on GitHub ↗

Helper trait to access the thread from a task.

Source from the content-addressed store, hash-verified

172
173/// Helper trait to access the thread from a task.
174pub trait AsThread {
175 /// Try to get the thread from the task.
176 fn try_as_thread(&self) -> Option<&Thread>;
177
178 /// Get the thread from the task, panicking if it is a kernel task.
179 fn as_thread(&self) -> &Thread {
180 self.try_as_thread().expect("kernel task")
181 }
182}
183
184impl AsThread for TaskInner {
185 fn try_as_thread(&self) -> Option<&Thread> {

Callers 8

new_currentMethod · 0.80
add_task_to_tableFunction · 0.80
get_process_dataFunction · 0.80
from_threadMethod · 0.80
with_replacen_blockedFunction · 0.80
new_user_taskFunction · 0.80
handle_futex_deathFunction · 0.80
do_exitFunction · 0.80

Implementers 1

task.rscore/src/task.rs

Calls

no outgoing calls

Tested by

no test coverage detected