Skip to content

Commit 053dc75

Browse files
nordic-krchcfriedt
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 b7954c9 commit 053dc75

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

kernel/timer.c

+3
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)