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

Function poll_timer

core/src/task.rs:429–440  ·  view source on GitHub ↗

Poll the timer

(task: &TaskInner)

Source from the content-addressed store, hash-verified

427
428/// Poll the timer
429pub fn poll_timer(task: &TaskInner) {
430 let Some(thr) = task.try_as_thread() else {
431 return;
432 };
433 let Ok(mut time) = thr.time.try_borrow_mut() else {
434 // reentrant borrow, likely IRQ
435 return;
436 };
437 time.poll(|signo| {
438 send_signal_thread_inner(task, thr, SignalInfo::new_kernel(signo));
439 });
440}
441
442/// Sets the timer state.
443pub fn set_timer_state(task: &TaskInner, state: TimerState) {

Callers 1

alarm_taskFunction · 0.85

Calls 3

send_signal_thread_innerFunction · 0.85
try_as_threadMethod · 0.80
pollMethod · 0.45

Tested by

no test coverage detected