[src] add assertion for debugging
This commit is contained in:
parent
29c7278edc
commit
ed58f6676d
|
@ -225,6 +225,7 @@ void rt_cpus_unlock(rt_base_t level)
|
||||||
|
|
||||||
if (pcpu->current_thread != RT_NULL)
|
if (pcpu->current_thread != RT_NULL)
|
||||||
{
|
{
|
||||||
|
RT_ASSERT(pcpu->current_thread->cpus_lock_nest > 0);
|
||||||
pcpu->current_thread->cpus_lock_nest--;
|
pcpu->current_thread->cpus_lock_nest--;
|
||||||
|
|
||||||
if (pcpu->current_thread->cpus_lock_nest == 0)
|
if (pcpu->current_thread->cpus_lock_nest == 0)
|
||||||
|
|
|
@ -292,7 +292,11 @@ static void rt_thread_system_entry(void *parameter)
|
||||||
{
|
{
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
rt_sem_take(&system_sem, RT_WAITING_FOREVER);
|
int ret= rt_sem_take(&system_sem, RT_WAITING_FOREVER);
|
||||||
|
if (ret != RT_EOK)
|
||||||
|
{
|
||||||
|
RT_ASSERT(0);
|
||||||
|
}
|
||||||
rt_defunct_execute();
|
rt_defunct_execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -666,6 +666,7 @@ void rt_scheduler_do_irq_switch(void *context)
|
||||||
#endif /* RT_USING_OVERFLOW_CHECK */
|
#endif /* RT_USING_OVERFLOW_CHECK */
|
||||||
RT_DEBUG_LOG(RT_DEBUG_SCHEDULER, ("switch in interrupt\n"));
|
RT_DEBUG_LOG(RT_DEBUG_SCHEDULER, ("switch in interrupt\n"));
|
||||||
|
|
||||||
|
RT_ASSERT(current_thread->cpus_lock_nest > 0);
|
||||||
current_thread->cpus_lock_nest--;
|
current_thread->cpus_lock_nest--;
|
||||||
current_thread->scheduler_lock_nest--;
|
current_thread->scheduler_lock_nest--;
|
||||||
|
|
||||||
|
@ -941,6 +942,7 @@ void rt_enter_critical(void)
|
||||||
{
|
{
|
||||||
rt_uint16_t lock_nest = current_thread->cpus_lock_nest;
|
rt_uint16_t lock_nest = current_thread->cpus_lock_nest;
|
||||||
current_thread->cpus_lock_nest++;
|
current_thread->cpus_lock_nest++;
|
||||||
|
RT_ASSERT(current_thread->cpus_lock_nest != 0);
|
||||||
if (lock_nest == 0)
|
if (lock_nest == 0)
|
||||||
{
|
{
|
||||||
current_thread->scheduler_lock_nest ++;
|
current_thread->scheduler_lock_nest ++;
|
||||||
|
@ -999,6 +1001,7 @@ void rt_exit_critical(void)
|
||||||
|
|
||||||
current_thread->critical_lock_nest --;
|
current_thread->critical_lock_nest --;
|
||||||
|
|
||||||
|
RT_ASSERT(current_thread->cpus_lock_nest > 0);
|
||||||
current_thread->cpus_lock_nest--;
|
current_thread->cpus_lock_nest--;
|
||||||
if (current_thread->cpus_lock_nest == 0)
|
if (current_thread->cpus_lock_nest == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -56,6 +56,7 @@ static void _signal_entry(void *parameter)
|
||||||
{
|
{
|
||||||
struct rt_cpu* pcpu = rt_cpu_self();
|
struct rt_cpu* pcpu = rt_cpu_self();
|
||||||
|
|
||||||
|
RT_ASSERT(current_thread->cpus_lock_nest > 0);
|
||||||
pcpu->current_thread->cpus_lock_nest--;
|
pcpu->current_thread->cpus_lock_nest--;
|
||||||
if (pcpu->current_thread->cpus_lock_nest == 0)
|
if (pcpu->current_thread->cpus_lock_nest == 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue