auto-sync

This commit is contained in:
rusEfi 2015-04-28 15:04:40 -04:00
parent c4e3bd9f2d
commit 341cc388be
1 changed files with 5 additions and 2 deletions

View File

@ -19,6 +19,7 @@
scheduling_s::scheduling_s() { scheduling_s::scheduling_s() {
callback = NULL; callback = NULL;
next = NULL; next = NULL;
param = NULL;
isScheduled = false; isScheduled = false;
} }
@ -124,7 +125,9 @@ int EventQueue::executeAll(uint64_t now) {
} }
if (current->momentX <= now) { if (current->momentX <= now) {
executionCounter++; executionCounter++;
LL_DELETE(head, current); efiAssert(head == current, "removing from head", -1);
//LL_DELETE(head, current);
head = head->next;
LL_PREPEND(executionList, current); LL_PREPEND(executionList, current);
} else { } else {
/** /**
@ -147,7 +150,7 @@ int EventQueue::executeAll(uint64_t now) {
uint32_t before = GET_TIMESTAMP(); uint32_t before = GET_TIMESTAMP();
current->isScheduled = false; current->isScheduled = false;
current->callback(current->param); current->callback(current->param);
// even with overflow it's safe to substract here // even with overflow it's safe to subtract here
lastEventQueueTime = GET_TIMESTAMP() - before; lastEventQueueTime = GET_TIMESTAMP() - before;
if (lastEventQueueTime > maxEventQueueTime) if (lastEventQueueTime > maxEventQueueTime)
maxEventQueueTime = lastEventQueueTime; maxEventQueueTime = lastEventQueueTime;