[Mesa-dev] [PATCH] mesa/glthread: correctly comparae thread handles

Manolova, Plamena plamena.manolova at intel.com
Thu Apr 20 17:11:43 UTC 2017


Looks good to me :)

Reviewed-by: Plamena Manolova <plamena.manolova at intel.com>

On Thu, Apr 20, 2017 at 8:24 AM, Emil Velikov <emil.l.velikov at gmail.com>
wrote:

> From: Emil Velikov <emil.velikov at collabora.com>
>
> As mentioned in the manual - comparing pthread_t handles via the C
> comparison operator is incorrect and pthread_equal() should be used
> instead.
>
> Cc: Timothy Arceri <tarceri at itsqueeze.com>
> Cc: Eric Anholt <eric at anholt.net>
> Fixes: d8d81fbc316 ("mesa: Add infrastructure for a worker thread to
> process GL commands.")
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
>  src/mesa/main/glthread.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/main/glthread.c b/src/mesa/main/glthread.c
> index c4d3f4a4349..455b829cd8d 100644
> --- a/src/mesa/main/glthread.c
> +++ b/src/mesa/main/glthread.c
> @@ -265,7 +265,7 @@ _mesa_glthread_finish(struct gl_context *ctx)
>      * dri interface entrypoints), in which case we don't need to actually
>      * synchronize against ourself.
>      */
> -   if (pthread_self() == glthread->thread)
> +   if (pthread_equal(pthread_self(), glthread->thread))
>        return;
>
>     pthread_mutex_lock(&glthread->mutex);
> --
> 2.12.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170420/5ca6b2c7/attachment-0001.html>


More information about the mesa-dev mailing list