Skip to content

[add] a macro to be isolated while using signals in rt_mutex_take fun… #3775

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -754,8 +756,10 @@ rt_err_t rt_mutex_take(rt_mutex_t mutex, rt_int32_t time)

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;
Expand Down