Browse Source

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>
pull/81166/head
Peter Mitsis 8 months ago committed by Mahesh Mahadevan
parent
commit
aeaddd70b7
  1. 2
      tests/benchmarks/sched/src/main.c

2
tests/benchmarks/sched/src/main.c

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

Loading…
Cancel
Save