Skip to content

Commit 8979fbc

Browse files
nordic-krchnashif
authored andcommitted
kernel: timer: Call user handler without spinlock
Add spinlock unlocking before calling timer expiration handler. Locking was introduced by dde3d6c. Signed-off-by: Krzysztof Chruscinski <[email protected]>
1 parent 02c32d4 commit 8979fbc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

kernel/timer.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ void z_timer_expiration_handler(struct _timeout *t)
4343

4444
/* invoke timer expiry function */
4545
if (timer->expiry_fn != NULL) {
46+
/* Unlock for user handler. */
47+
k_spin_unlock(&lock, key);
4648
timer->expiry_fn(timer);
49+
key = k_spin_lock(&lock);
4750
}
4851

4952
if (!IS_ENABLED(CONFIG_MULTITHREADING)) {

0 commit comments

Comments
 (0)