From 685254f5243335d7064f615c9c04b82f61b66fd1 Mon Sep 17 00:00:00 2001 From: Peter Mitsis Date: Wed, 14 Sep 2016 11:06:31 -0400 Subject: [PATCH] unified: Preemption check to include sched lock Change-Id: I8dc635bc53036938b249220d655dceb1f6f413f0 Signed-off-by: Peter Mitsis --- kernel/unified/include/sched.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/unified/include/sched.h b/kernel/unified/include/sched.h index ce5af68a9fd..b84f8e9c1a6 100644 --- a/kernel/unified/include/sched.h +++ b/kernel/unified/include/sched.h @@ -80,7 +80,7 @@ static inline int _is_coop(struct tcs *thread) /* is thread currently preemptible ? */ static inline int _is_preempt(struct tcs *thread) { - return !_is_coop(thread); + return !_is_coop(thread) && !atomic_get(&thread->sched_locked); } /* is current thread preemptible and we are not running in ISR context */