Mesa (17.1): mesa/glthread: correctly compare thread handles
Emil Velikov
evelikov at kemper.freedesktop.org
Mon Apr 24 14:32:51 UTC 2017
Module: Mesa
Branch: 17.1
Commit: 612fc14aab46e85452915d6e77fffee7bb94cfe5
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=612fc14aab46e85452915d6e77fffee7bb94cfe5
Author: Emil Velikov <emil.velikov at collabora.com>
Date: Thu Apr 20 16:24:08 2017 +0100
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 <tarceri at itsqueeze.com>
Fixes: d8d81fbc316 ("mesa: Add infrastructure for a worker thread to process GL commands.")
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
Reviewed-by: Plamena Manolova <plamena.manolova at intel.com>
Reviewed-by: Brian Paul <brianp at vmware.com>
Reviewed-by: Eric Anholt <eric at anholt.net>
(cherry picked from commit 52df318d61f4892dbbaa8f0da4787f25caf1b0d1)
---
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 c4d3f4a434..455b829cd8 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);
More information about the mesa-commit
mailing list