[src][thread]fix rt_thread_resume return value error (#9114)

fix rt_thread_resume return value error
This commit is contained in:
zms123456 2024-06-29 11:27:39 +08:00 committed by GitHub
parent df715100f2
commit c018a3e3fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 0 deletions

View File

@ -1018,6 +1018,15 @@ rt_err_t rt_thread_resume(rt_thread_t thread)
if (!error)
{
error = rt_sched_unlock_n_resched(slvl);
/**
* RT_ESCHEDLOCKED indicates that the current thread is in a critical section,
* rather than 'thread' can't be resumed. Therefore, we can ignore this error.
*/
if (error == -RT_ESCHEDLOCKED)
{
error = RT_EOK;
}
}
else
{