[kernel][src] improve code (#7367)

This commit is contained in:
半吊子内核开发 2023-05-17 07:36:24 +08:00 committed by GitHub
parent 5f8b33f85d
commit 442330cc54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -588,8 +588,8 @@ rt_err_t rt_thread_yield(void)
level = rt_hw_interrupt_disable();
thread->remaining_tick = thread->init_tick;
thread->stat |= RT_THREAD_STAT_YIELD;
rt_schedule();
rt_hw_interrupt_enable(level);
rt_schedule();
return RT_EOK;
}