Skip to content

Commit a78c6be

Browse files
author
chenchaoqun
committed
[add] a macro to be isolated while using signals in rt_mutex_take function.
1 parent e6b7215 commit a78c6be

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/ipc.c

+4
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,9 @@ rt_err_t rt_mutex_take(rt_mutex_t mutex, rt_int32_t time)
685685
}
686686
else
687687
{
688+
#ifdef RT_USING_SIGNALS
688689
__again:
690+
#endif /* end of RT_USING_SIGNALS */
689691
/* The value of mutex is 1 in initial status. Therefore, if the
690692
* value is great than 0, it indicates the mutex is avaible.
691693
*/
@@ -754,8 +756,10 @@ rt_err_t rt_mutex_take(rt_mutex_t mutex, rt_int32_t time)
754756

755757
if (thread->error != RT_EOK)
756758
{
759+
#ifdef RT_USING_SIGNALS
757760
/* interrupt by signal, try it again */
758761
if (thread->error == -RT_EINTR) goto __again;
762+
#endif /* end of RT_USING_SIGNALS */
759763

760764
/* return error */
761765
return thread->error;

0 commit comments

Comments
 (0)