summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2020-08-03 21:19:30 +0800
committerGitHub <[email protected]>2020-08-03 21:19:30 +0800
commit70142efbf236d0657d912414e56f8fd027ea3ba5 (patch)
tree8dd1e5ede739bc08b80f01184b48e709cebe36b4 /src
parent65d4e732ccdd667d6585d1d34ea14f3153c34845 (diff)
parenta78c6bedea2bb4e9833fdb2cc22f3af813724609 (diff)
Merge pull request #3775 from ErnestChen1/event_goto
[add] a macro to be isolated while using signals in rt_mutex_take fun…
Diffstat (limited to 'src')
-rw-r--r--src/ipc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ipc.c b/src/ipc.c
index 067bd5f7ba..baf5e6306a 100644
--- a/src/ipc.c
+++ b/src/ipc.c
@@ -690,7 +690,9 @@ rt_err_t rt_mutex_take(rt_mutex_t mutex, rt_int32_t time)
}
else
{
+#ifdef RT_USING_SIGNALS
__again:
+#endif /* end of RT_USING_SIGNALS */
/* The value of mutex is 1 in initial status. Therefore, if the
* value is great than 0, it indicates the mutex is avaible.
*/
@@ -759,8 +761,10 @@ __again:
if (thread->error != RT_EOK)
{
+#ifdef RT_USING_SIGNALS
/* interrupt by signal, try it again */
if (thread->error == -RT_EINTR) goto __again;
+#endif /* end of RT_USING_SIGNALS */
/* return error */
return thread->error;