Skip to content

Commit 70142ef

Browse files
authored
Merge pull request #3775 from ErnestChen1/event_goto
[add] a macro to be isolated while using signals in rt_mutex_take fun…
2 parents 65d4e73 + a78c6be commit 70142ef

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
@@ -690,7 +690,9 @@ rt_err_t rt_mutex_take(rt_mutex_t mutex, rt_int32_t time)
690690
}
691691
else
692692
{
693+
#ifdef RT_USING_SIGNALS
693694
__again:
695+
#endif /* end of RT_USING_SIGNALS */
694696
/* The value of mutex is 1 in initial status. Therefore, if the
695697
* value is great than 0, it indicates the mutex is avaible.
696698
*/
@@ -759,8 +761,10 @@ rt_err_t rt_mutex_take(rt_mutex_t mutex, rt_int32_t time)
759761

760762
if (thread->error != RT_EOK)
761763
{
764+
#ifdef RT_USING_SIGNALS
762765
/* interrupt by signal, try it again */
763766
if (thread->error == -RT_EINTR) goto __again;
767+
#endif /* end of RT_USING_SIGNALS */
764768

765769
/* return error */
766770
return thread->error;

0 commit comments

Comments
 (0)