git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6464 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
014b752b76
commit
5a70ffdbf3
|
@ -82,8 +82,8 @@ extern "C" {
|
||||||
#include "chdebug.h"
|
#include "chdebug.h"
|
||||||
#include "chtm.h"
|
#include "chtm.h"
|
||||||
#include "chstats.h"
|
#include "chstats.h"
|
||||||
#include "chsys.h"
|
|
||||||
#include "chglobal.h"
|
#include "chglobal.h"
|
||||||
|
#include "chsys.h"
|
||||||
#include "chvt.h"
|
#include "chvt.h"
|
||||||
#include "chlists.h"
|
#include "chlists.h"
|
||||||
#include "chschd.h"
|
#include "chschd.h"
|
||||||
|
|
|
@ -71,6 +71,13 @@
|
||||||
/* Derived constants and error checks. */
|
/* Derived constants and error checks. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
#if CH_DBG_ENABLE_ASSERTS || CH_DBG_ENABLE_CHECKS || \
|
||||||
|
CH_DBG_ENABLE_STACK_CHECK || CH_DBG_SYSTEM_STATE_CHECK
|
||||||
|
#define CH_DBG_ENABLED TRUE
|
||||||
|
#else
|
||||||
|
#define CH_DBG_ENABLED FALSE
|
||||||
|
#endif
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Module data structures and types. */
|
/* Module data structures and types. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
|
@ -299,6 +299,14 @@ static inline void chSysUnlock(void) {
|
||||||
|
|
||||||
_dbg_check_unlock();
|
_dbg_check_unlock();
|
||||||
_stats_stop_measure_crit_thd();
|
_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();
|
port_unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -399,6 +399,7 @@ static void mtx4_execute(void) {
|
||||||
test_assert(11, chThdGetPriorityX() == p2, "wrong priority level");
|
test_assert(11, chThdGetPriorityX() == p2, "wrong priority level");
|
||||||
chSysLock();
|
chSysLock();
|
||||||
chMtxUnlockS();
|
chMtxUnlockS();
|
||||||
|
chSchRescheduleS();
|
||||||
chSysUnlock();
|
chSysUnlock();
|
||||||
test_assert(12, chThdGetPriorityX() == p1, "wrong priority level");
|
test_assert(12, chThdGetPriorityX() == p1, "wrong priority level");
|
||||||
chThdSleepMilliseconds(100);
|
chThdSleepMilliseconds(100);
|
||||||
|
|
|
@ -102,6 +102,7 @@ static void sem1_execute(void) {
|
||||||
threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX()+5, thread1, "A");
|
threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX()+5, thread1, "A");
|
||||||
chSysLock();
|
chSysLock();
|
||||||
chSemAddCounterI(&sem1, 2);
|
chSemAddCounterI(&sem1, 2);
|
||||||
|
chSchRescheduleS();
|
||||||
chSysUnlock();
|
chSysUnlock();
|
||||||
test_wait_threads();
|
test_wait_threads();
|
||||||
test_assert_lock(2, chSemGetCounterI(&sem1) == 1, "invalid counter");
|
test_assert_lock(2, chSemGetCounterI(&sem1) == 1, "invalid counter");
|
||||||
|
|
Loading…
Reference in New Issue