diff options
| author | zms123456 <[email protected]> | 2024-06-29 11:27:39 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-06-29 11:27:39 +0800 |
| commit | c018a3e3fd701402a4b83da614e79ea5ba66514d (patch) | |
| tree | 22e9f38f508055c23945570f0259b5f73559b7ed /src | |
| parent | df715100f2239d2ee12be486e1fa1b1c6fa361c1 (diff) | |
[src][thread]fix rt_thread_resume return value error (#9114)
fix rt_thread_resume return value error
Diffstat (limited to 'src')
| -rw-r--r-- | src/thread.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/thread.c b/src/thread.c index 1369b7560a..1327c47bbb 100644 --- a/src/thread.c +++ b/src/thread.c @@ -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 { |
