diff options
| author | Shell <[email protected]> | 2024-05-10 09:17:19 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-05-10 09:17:19 +0800 |
| commit | 017b2a5a4461f349958e4b7c629679df3b1f9d7f (patch) | |
| tree | 1e002e1313ba7f66f7118c7373014bbd26d651bd /src/thread.c | |
| parent | 5712ff1a32dbd1db76d75e00fca3558d8b1c9c6b (diff) | |
[smart] fixup arm64 aspace switch (#8925)
* [smart] fixup arm64 aspace switch
Signed-off-by: Shell <[email protected]>
* fixup: arm add arch_kernel_mmu_table_get
---------
Signed-off-by: Shell <[email protected]>
Diffstat (limited to 'src/thread.c')
| -rw-r--r-- | src/thread.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/src/thread.c b/src/thread.c index 170d61eec8..77f65bc68b 100644 --- a/src/thread.c +++ b/src/thread.c @@ -912,25 +912,28 @@ rt_err_t rt_thread_suspend_to_list(rt_thread_t thread, rt_list_t *susp_list, int } #ifdef RT_USING_SMART - rt_sched_unlock(slvl); - - /* check pending signals for thread before suspend */ - if (lwp_thread_signal_suspend_check(thread, suspend_flag) == 0) + if (thread->lwp) { - /* not to suspend */ - return -RT_EINTR; - } + rt_sched_unlock(slvl); - rt_sched_lock(&slvl); - if (stat == RT_THREAD_READY) - { - stat = rt_sched_thread_get_stat(thread); + /* check pending signals for thread before suspend */ + if (lwp_thread_signal_suspend_check(thread, suspend_flag) == 0) + { + /* not to suspend */ + return -RT_EINTR; + } - if (stat != RT_THREAD_READY) + rt_sched_lock(&slvl); + if (stat == RT_THREAD_READY) { - /* status updated while we check for signal */ - rt_sched_unlock(slvl); - return -RT_ERROR; + stat = rt_sched_thread_get_stat(thread); + + if (stat != RT_THREAD_READY) + { + /* status updated while we check for signal */ + rt_sched_unlock(slvl); + return -RT_ERROR; + } } } #endif |
