aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt/include/chsys.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/rt/include/chsys.h')
-rw-r--r--os/rt/include/chsys.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/os/rt/include/chsys.h b/os/rt/include/chsys.h
index 6255b7d5a..9a74788ae 100644
--- a/os/rt/include/chsys.h
+++ b/os/rt/include/chsys.h
@@ -299,6 +299,14 @@ static inline void chSysUnlock(void) {
_dbg_check_unlock();
_stats_stop_measure_crit_thd();
+
+ /* The following condition can be triggered by the use of i-class functions
+ in a critical section not followed by a chSchResceduleS(), this means
+ that the current thread has a lower priority than the next thread in
+ the ready list.*/
+ chDbgAssert(ch.rlist.r_current->p_prio >= ch.rlist.r_queue.p_next->p_prio,
+ "priority violation, missing reschedule");
+
port_unlock();
}