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@itsqueeze.com>
Fixes: d8d81fbc31 ("mesa: Add infrastructure for a worker thread to process GL commands.")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Plamena Manolova <plamena.manolova@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
Emil Velikov
2017-04-20 16:24:08 +01:00
committed by Emil Velikov
parent dd6ec78b4f
commit 52df318d61
+1 -1
View File
@@ -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);