summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchenchaoqun <[email protected]>2020-07-27 14:01:30 +0800
committerchenchaoqun <[email protected]>2020-07-27 14:01:30 +0800
commita78c6bedea2bb4e9833fdb2cc22f3af813724609 (patch)
treebf3706e8d21760d81287d9e9da68612f2c9b9c28
parente6b72153b440ae6eb9cf98bdc44c29903042373f (diff)
[add] a macro to be isolated while using signals in rt_mutex_take function.
-rw-r--r--src/ipc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ipc.c b/src/ipc.c
index 8e8c4db842..b0efdd1320 100644
--- a/src/ipc.c
+++ b/src/ipc.c
@@ -685,7 +685,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.
*/
@@ -754,8 +756,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;