On 15.07.19 23:30, Richard Weinberger via Xenomai wrote:
> Hi!
> 
> Sorry for asking so many questions on RT_MUTEX.
> 
> Docs on rt_mutex_acquire variants state:
> -EINTR is returned if rt_task_unblock() was called for the current task.
> 
> This does not seems to be the case, pthread_mutex_lock() in lib/cobalt/mutex.c
> does:
>         do
>                 ret = XENOMAI_SYSCALL1(sc_cobalt_mutex_lock, _mutex);
>         while (ret == -EINTR);
> 
> So, upon rt_task_unblock() the while loop does one more iteration but
> blocks again
> and the function will never return with -EINTR.

Apparently, we lost that property when porting alchemy over the cobalt core. I'd
first like to understand if that was accidental or intentional - Philippe?

> 
> I guess the recommenced approach is posting a signal to a task before calling
> rt_task_unblock()? Then the task can exit in a more or less controlled way.
> 

Signals are hairy and non-RT. If such a workaround fits depends on your use
case. Maybe you can describe that in more details.

Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

Reply via email to