Skip to content

Commit aeaddd7

Browse files
peter-mitsismmahadevan108
authored andcommitted
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 <[email protected]>
1 parent 18818c1 commit aeaddd7

File tree

1 file changed

+1
-1
lines changed
  • tests/benchmarks/sched/src

1 file changed

+1
-1
lines changed

tests/benchmarks/sched/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ int main(void)
112112
key = arch_irq_lock();
113113
stamp(UNPENDING);
114114
z_unpend_first_thread(&waitq);
115+
arch_irq_unlock(key);
115116
stamp(UNPENDED_READYING);
116117
z_ready_thread(th);
117118
stamp(READIED_YIELDING);
@@ -124,7 +125,6 @@ int main(void)
124125
*/
125126
k_yield();
126127
stamp(YIELDED);
127-
arch_irq_unlock(key);
128128

129129
uint32_t avg, whole = stamps[4] - stamps[0];
130130

0 commit comments

Comments
 (0)