From 52df318d61f4892dbbaa8f0da4787f25caf1b0d1 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Thu, 20 Apr 2017 16:24:08 +0100 Subject: [PATCH] mesa/glthread: correctly compare thread handles 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 Fixes: d8d81fbc316 ("mesa: Add infrastructure for a worker thread to process GL commands.") Signed-off-by: Emil Velikov Reviewed-by: Plamena Manolova Reviewed-by: Brian Paul Reviewed-by: Eric Anholt --- 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 c4d3f4a..455b829 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.7.4