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

Method renew_timer

core/src/time.rs:105–119  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

103 }
104
105 pub fn renew_timer(&self) {
106 if self.remained_ns > 0 {
107 let deadline = wall_time() + Duration::from_nanos(self.remained_ns as u64);
108 let mut guard = ALARM_LIST.lock();
109 let should_wake = guard.peek().is_none_or(|it| it.deadline > deadline);
110 guard.push(Entry {
111 deadline,
112 task: Arc::downgrade(&current()),
113 });
114 drop(guard);
115 if should_wake {
116 EVENT_NEW_TIMER.notify(1);
117 }
118 }
119 }
120}
121
122/// Represents the state of the timer.

Callers 2

newMethod · 0.80
updateMethod · 0.80

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected