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

Function set_timer_state

core/src/task.rs:443–455  ·  view source on GitHub ↗

Sets the timer state.

(task: &TaskInner, state: TimerState)

Source from the content-addressed store, hash-verified

441
442/// Sets the timer state.
443pub fn set_timer_state(task: &TaskInner, state: TimerState) {
444 let Some(thr) = task.try_as_thread() else {
445 return;
446 };
447 let Ok(mut time) = thr.time.try_borrow_mut() else {
448 // reentrant borrow, likely IRQ
449 return;
450 };
451 time.poll(|signo| {
452 send_signal_thread_inner(task, thr, SignalInfo::new_kernel(signo));
453 });
454 time.set_state(state);
455}
456
457fn send_signal_thread_inner(task: &TaskInner, thr: &Thread, sig: SignalInfo) {
458 if thr.signal.send_signal(sig) {

Callers 1

new_user_taskFunction · 0.85

Calls 4

send_signal_thread_innerFunction · 0.85
try_as_threadMethod · 0.80
set_stateMethod · 0.80
pollMethod · 0.45

Tested by

no test coverage detected