[Xenomai] EINTR in notifier.c (mercury)

Gilles Chanteperdrix gilles.chanteperdrix at xenomai.org
Sun Apr 6 17:09:34 CEST 2014


On 04/06/2014 05:04 PM, Philippe Gerum wrote:
> @@ -1093,7 +1093,9 @@ int threadobj_sleep(struct timespec *ts)
>  	 */
>  	current->run_state = __THREAD_S_DELAYED;
>  	threadobj_save_timeout(&current->core, ts);
> -	ret = -__RT(clock_nanosleep(CLOCK_COPPERPLATE, TIMER_ABSTIME, ts, NULL));
> +	do
> +		ret = -__RT(clock_nanosleep(CLOCK_COPPERPLATE, TIMER_ABSTIME, ts, NULL));
> 
> We should definitely pass and use the "remain" field in clock_nanosleep(), not to restart a complete wait each time we get interrupted.
> 

The remain field only makes sense without TIMER_ABSTIME. With
TIMER_ABSTIME, since the wake-up time is absolute, passing it again to
clock_nanosleep should be fine.

-- 
                                                                Gilles.




More information about the Xenomai mailing list