MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / runTimers

Function runTimers

source/kernel/kscheduler.cpp:26–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24static KList<KTimerCallback*> timers;
25static BOXEDWINE_MUTEX timerMutex;
26void runTimers() {
27 BOXEDWINE_CRITICAL_SECTION_WITH_MUTEX(timerMutex);
28 U32 millies = KSystem::getMilliesSinceStart();
29 timers.for_each([millies](KListNode<KTimerCallback*>* node) {
30 KTimerCallback* timer = node->data;
31
32 if (timer->millies <= millies) {
33 if (timer->run()) {
34 timer->node.remove();
35 }
36 }
37 });
38}
39
40U32 getNextTimer() {
41 BOXEDWINE_CRITICAL_SECTION_WITH_MUTEX(timerMutex);

Callers 3

doMainLoopFunction · 0.85
mainloopFunction · 0.85
runSliceFunction · 0.85

Calls 3

for_eachMethod · 0.45
runMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected