[ulog] Optimize code to improve readability.
This commit is contained in:
parent
615824b5e3
commit
af702e048d
@ -191,7 +191,7 @@ static void output_unlock(void)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* If the scheduler is started and in thread context */
|
/* If the scheduler is started and in thread context */
|
||||||
if (rt_thread_self() && (rt_interrupt_get_nest() == 0))
|
if (rt_interrupt_get_nest() == 0 && rt_thread_self() != RT_NULL)
|
||||||
{
|
{
|
||||||
rt_sem_release(&ulog.output_locker);
|
rt_sem_release(&ulog.output_locker);
|
||||||
}
|
}
|
||||||
@ -209,7 +209,7 @@ static void output_lock(void)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* If the scheduler is started and in thread context */
|
/* If the scheduler is started and in thread context */
|
||||||
if (rt_thread_self() && (rt_interrupt_get_nest() == 0))
|
if (rt_interrupt_get_nest() == 0 && rt_thread_self() != RT_NULL)
|
||||||
{
|
{
|
||||||
rt_sem_take(&ulog.output_locker, RT_WAITING_FOREVER);
|
rt_sem_take(&ulog.output_locker, RT_WAITING_FOREVER);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user