tests: Fix IRQ locking in sched benchmark

Corrects an issue that was introduced when the interrupt
locking/unlocking was added to the 'sched' benchmark by
unlocking the interrupts before the context switch done by
k_yield(), but after the call to z_unpend_first_thread().

Fixes PR #81050

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
This commit is contained in:
Peter Mitsis 2024-11-07 14:15:04 -08:00 committed by Mahesh Mahadevan
commit aeaddd70b7

View file

@ -112,6 +112,7 @@ int main(void)
key = arch_irq_lock(); key = arch_irq_lock();
stamp(UNPENDING); stamp(UNPENDING);
z_unpend_first_thread(&waitq); z_unpend_first_thread(&waitq);
arch_irq_unlock(key);
stamp(UNPENDED_READYING); stamp(UNPENDED_READYING);
z_ready_thread(th); z_ready_thread(th);
stamp(READIED_YIELDING); stamp(READIED_YIELDING);
@ -124,7 +125,6 @@ int main(void)
*/ */
k_yield(); k_yield();
stamp(YIELDED); stamp(YIELDED);
arch_irq_unlock(key);
uint32_t avg, whole = stamps[4] - stamps[0]; uint32_t avg, whole = stamps[4] - stamps[0];