detect "not scheduled" faster (#3200)

* fatal if not found

* handle not-scheduled

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
This commit is contained in:
Matthew Kennedy 2021-08-27 01:46:01 -07:00 committed by GitHub
parent 0c6297e926
commit da5aaeda2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -77,6 +77,11 @@ void EventQueue::remove(scheduling_s* scheduling) {
assertListIsSorted(); assertListIsSorted();
#endif /* EFI_UNIT_TEST */ #endif /* EFI_UNIT_TEST */
// Special case: event isn't scheduled, so don't cancel it
if (!scheduling->action) {
return;
}
// Special case: empty list, nothing to do // Special case: empty list, nothing to do
if (!head) { if (!head) {
return; return;
@ -97,8 +102,9 @@ void EventQueue::remove(scheduling_s* scheduling) {
current = current->nextScheduling_s; current = current->nextScheduling_s;
} }
// Walked off the end, not present, nothing more to do // Walked off the end, this is an error since this *should* have been scheduled
if (!current) { if (!current) {
firmwareError(OBD_PCM_Processor_Fault, "EventQueue::remove didn't find element");
return; return;
} }