mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-30 05:10:26 +08:00
[add] a macro to be isolated while using signals in rt_mutex_take function.
This commit is contained in:
parent
e6b72153b4
commit
a78c6bedea
@ -685,7 +685,9 @@ rt_err_t rt_mutex_take(rt_mutex_t mutex, rt_int32_t time)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#ifdef RT_USING_SIGNALS
|
||||||
__again:
|
__again:
|
||||||
|
#endif /* end of RT_USING_SIGNALS */
|
||||||
/* The value of mutex is 1 in initial status. Therefore, if the
|
/* The value of mutex is 1 in initial status. Therefore, if the
|
||||||
* value is great than 0, it indicates the mutex is avaible.
|
* value is great than 0, it indicates the mutex is avaible.
|
||||||
*/
|
*/
|
||||||
@ -754,8 +756,10 @@ __again:
|
|||||||
|
|
||||||
if (thread->error != RT_EOK)
|
if (thread->error != RT_EOK)
|
||||||
{
|
{
|
||||||
|
#ifdef RT_USING_SIGNALS
|
||||||
/* interrupt by signal, try it again */
|
/* interrupt by signal, try it again */
|
||||||
if (thread->error == -RT_EINTR) goto __again;
|
if (thread->error == -RT_EINTR) goto __again;
|
||||||
|
#endif /* end of RT_USING_SIGNALS */
|
||||||
|
|
||||||
/* return error */
|
/* return error */
|
||||||
return thread->error;
|
return thread->error;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user