提交 af702e04 编写于 作者: G guozhanxin 提交者: guo

[ulog] Optimize code to improve readability.

上级 615824b5
......@@ -191,7 +191,7 @@ static void output_unlock(void)
return;
/* 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);
}
......@@ -209,7 +209,7 @@ static void output_lock(void)
return;
/* 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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册