[PATCH i-g-t v9 07/14] lib/igt_dummyload: Avoid pthread_cancel use by overriding timer value

Kamil Konieczny kamil.konieczny at linux.intel.com
Thu May 22 11:53:14 UTC 2025


Hi Jeevaka,
On 2025-05-19 at 15:11:28 +0000, Jeevaka Prabu Badrappan wrote:
> Android build fails due to pthread_cancel unavailability.
> Replace pthread_cancel by overriding the expiration time of the timer.

s/Replace pthread_cancel/Replace it/
It could be done at merge.

> 
> Signed-off-by: Jeevaka Prabu Badrappan <jeevaka.badrappan at intel.com>
> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>

I merged this and next patch. Thank you!

Regards,
Kamil

> ---
>  lib/igt_dummyload.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
> index 3cf80b762..cc0b4ac3b 100644
> --- a/lib/igt_dummyload.c
> +++ b/lib/igt_dummyload.c
> @@ -631,7 +631,16 @@ void igt_spin_end(igt_spin_t *spin)
>  static void __igt_spin_free(int fd, igt_spin_t *spin)
>  {
>  	if (spin->timerfd >= 0) {
> +#ifdef ANDROID
> +		struct itimerspec its;
> +
> +		memset(&its, 0, sizeof(its));
> +		its.it_value.tv_sec = 0;
> +		its.it_value.tv_nsec = 1;
> +		timerfd_settime(spin->timerfd, 0, &its, NULL);
> +#else
>  		pthread_cancel(spin->timer_thread);
> +#endif
>  		igt_assert(pthread_join(spin->timer_thread, NULL) == 0);
>  		close(spin->timerfd);
>  	}
> -- 
> 2.49.0
> 


More information about the igt-dev mailing list