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

Function getNextTimer

source/kernel/kscheduler.cpp:40–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40U32 getNextTimer() {
41 BOXEDWINE_CRITICAL_SECTION_WITH_MUTEX(timerMutex);
42 U32 millies = KSystem::getMilliesSinceStart();
43 U32 result = 0xFFFFFFFF;
44
45 timers.for_each([millies, &result](KListNode<KTimerCallback*>* node) {
46 KTimerCallback* timer = node->data;
47 U32 next = 0;
48
49 if (timer->millies <= millies) {
50 next = 0;
51 }
52 else {
53 next = timer->millies - millies;
54 }
55 if (next < result) {
56 result = next;
57 }
58 });
59 return result;
60}
61
62void addTimer(KTimerCallback* timer) {
63 BOXEDWINE_CRITICAL_SECTION_WITH_MUTEX(timerMutex);

Callers 2

doMainLoopFunction · 0.85
mainloopFunction · 0.85

Calls 1

for_eachMethod · 0.45

Tested by

no test coverage detected