[Mesa-dev] [PATCH] mesa: stop glthread on exit

Nicolai Hähnle nhaehnle at gmail.com
Mon May 8 09:47:10 UTC 2017


On 04.05.2017 17:16, Bartosz Tomczyk wrote:
> It fixes occasional crashes when app exits
> and glthread is still processing commands.
> ---
>  src/mesa/main/context.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
> index 3570f94f5a..c3c4095329 100644
> --- a/src/mesa/main/context.c
> +++ b/src/mesa/main/context.c
> @@ -354,6 +354,9 @@ mtx_t OneTimeLock = _MTX_INITIALIZER_NP;
>  static void
>  one_time_fini(void)
>  {
> +   GET_CURRENT_CONTEXT(ctx);
> +   if (ctx)
> +      _mesa_glthread_destroy(ctx);

NAK, this makes no sense. one_time_fini is called once for the whole 
process, but there might be many GL contexts per process, and each one 
would have its own GL thread.

What are the crashes you're seeing? Let's fix the underlying problem 
instead.

Cheers,
Nicolai


>     _mesa_destroy_shader_compiler();
>     _mesa_locale_fini();
>  }
>


-- 
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.


More information about the mesa-dev mailing list