On 07/25/2017 08:54 PM, Jan Kiszka wrote:
> Hi all,
> 
> don't we need this?
> 
> diff --git a/kernel/cobalt/thread.c b/kernel/cobalt/thread.c
> index ab457da70..604179f68 100644
> --- a/kernel/cobalt/thread.c
> +++ b/kernel/cobalt/thread.c
> @@ -920,8 +920,13 @@ void xnthread_suspend(struct xnthread *thread, int mask,
>                           (oldstate & XNTRAPLB) != 0)
>                               goto lock_break;
>               }
> -             xnthread_clear_info(thread,
> -                                 
> XNRMID|XNTIMEO|XNBREAK|XNWAKEN|XNROBBED|XNKICKED);
> +             /*
> +              * Do not destroy the info left behind by yet unprocessed
> +              * wakeups when suspending a remote thread.
> +              */
> +             if (thread == sched->curr)
> +                     xnthread_clear_info(thread, XNRMID|XNTIMEO|XNBREAK|
> +                                                 XNWAKEN|XNROBBED|XNKICKED);
>       }
>  
>       /*
> 
> Let's assume a high prio thread is running and a low-prio is waiting for
> a timeout. Now the timeout occurs, and the low-prio is woken up but
> can't run yet. If the high-prio suspends the low-prio, XNWIMEO will be
> lost.
> 
> I've run into this with complex out-of-tree modifications, but this
> seems to affect upstream as well, no?
> 

Definitely, yes.

-- 
Philippe.

_______________________________________________
Xenomai mailing list
[email protected]
https://xenomai.org/mailman/listinfo/xenomai

Reply via email to