summaryrefslogtreecommitdiff
path: root/src/signal.c
diff options
context:
space:
mode:
authorguo <[email protected]>2022-12-03 12:07:44 +0800
committerGitHub <[email protected]>2022-12-03 12:07:44 +0800
commitecf2d8215961ca7c539132b62a72df6072cc3e14 (patch)
tree59005f0f74f2593c0435059264f624c862a89f55 /src/signal.c
parentaaf5462c6d4ae9466a0a8cd2a4bb00cfe1fef2f2 (diff)
sync branch rt-smart. (#6641)
* Synchronize the code of the rt mart branch to the master branch. * TTY device * Add lwP code from rt-smart * Add vnode in DFS, but DFS will be re-write for rt-smart * There are three libcpu for rt-smart: * arm/cortex-a, arm/aarch64 * riscv64 Co-authored-by: Rbb666 <[email protected]> Co-authored-by: zhkag <[email protected]>
Diffstat (limited to 'src/signal.c')
-rw-r--r--src/signal.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/signal.c b/src/signal.c
index 60996a6e08..e24bb931d7 100644
--- a/src/signal.c
+++ b/src/signal.c
@@ -102,10 +102,14 @@ static void _signal_deliver(rt_thread_t tid)
return;
}
- if ((tid->stat & RT_THREAD_STAT_MASK) == RT_THREAD_SUSPEND)
+ if ((tid->stat & RT_THREAD_SUSPEND_MASK) == RT_THREAD_SUSPEND_MASK)
{
/* resume thread to handle signal */
+#ifdef RT_USING_LWP
+ rt_thread_wakeup(tid);
+#else
rt_thread_resume(tid);
+#endif
/* add signal state */
tid->stat |= (RT_THREAD_STAT_SIGNAL | RT_THREAD_STAT_SIGNAL_PENDING);
@@ -197,7 +201,7 @@ void *rt_signal_check(void* context)
rt_hw_interrupt_enable(level);
sig_context = rt_hw_stack_init((void *)_signal_entry, context,
- (void *)(context - 32), RT_NULL);
+ (void*)((char*)context - 32), RT_NULL);
return sig_context;
}
}
@@ -350,7 +354,7 @@ int rt_signal_wait(const rt_sigset_t *set, rt_siginfo_t *si, rt_int32_t timeout)
}
/* suspend self thread */
- rt_thread_suspend(tid);
+ rt_thread_suspend_with_flag(tid, RT_UNINTERRUPTIBLE);
/* set thread stat as waiting for signal */
tid->stat |= RT_THREAD_STAT_SIGNAL_WAIT;