diff options
| author | Shell <[email protected]> | 2023-07-20 00:02:41 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-07-20 00:02:41 +0800 |
| commit | 58e0ddf2879032495a74897c34e3605de929f82c (patch) | |
| tree | 097f18153aa9dbf18c12565957a7e25ade127b23 /src/thread.c | |
| parent | c732cc0083be02335c189e36a651bcb3496bda0d (diff) | |
[component/lwp] support more feature of signal from IEEE Std 1003.1-2017 (#7828)
Signed-off-by: Shell <[email protected]>
Diffstat (limited to 'src/thread.c')
| -rw-r--r-- | src/thread.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/thread.c b/src/thread.c index 61f3e289f9..ad8712c899 100644 --- a/src/thread.c +++ b/src/thread.c @@ -262,10 +262,12 @@ static rt_err_t _thread_init(struct rt_thread *thread, #ifdef RT_USING_SMART thread->lwp = RT_NULL; rt_list_init(&(thread->sibling)); - rt_memset(&thread->signal, 0, sizeof(lwp_sigset_t)); - rt_memset(&thread->signal_mask, 0, sizeof(lwp_sigset_t)); - thread->signal_mask_bak = 0; - thread->signal_in_process = 0; + + /* lwp thread-signal init */ + rt_memset(&thread->signal.sigset_mask, 0, sizeof(lwp_sigset_t)); + rt_memset(&thread->signal.sig_queue.sigset_pending, 0, sizeof(lwp_sigset_t)); + rt_list_init(&thread->signal.sig_queue.siginfo_list); + rt_memset(&thread->user_ctx, 0, sizeof thread->user_ctx); #endif @@ -935,7 +937,7 @@ rt_err_t rt_thread_control(rt_thread_t thread, int cmd, void *arg) RTM_EXPORT(rt_thread_control); #ifdef RT_USING_SMART -int lwp_suspend_sigcheck(rt_thread_t thread, int suspend_flag); +#include <lwp_signal.h> #endif static void rt_thread_set_suspend_state(struct rt_thread *thread, int suspend_flag) @@ -1004,7 +1006,7 @@ rt_err_t rt_thread_suspend_with_flag(rt_thread_t thread, int suspend_flag) RT_ASSERT(thread == rt_thread_self()); } #ifdef RT_USING_SMART - if (lwp_suspend_sigcheck(thread, suspend_flag) == 0) + if (lwp_thread_signal_suspend_check(thread, suspend_flag) == 0) { /* not to suspend */ rt_hw_interrupt_enable(level); |
