glx: make sure contexts are destroyed before we exit the test

Submitted by Timothy Arceri on April 12, 2019, 6:23 a.m.

Details

Message ID 20190412062339.16101-1-tarceri@itsqueeze.com
State New
Headers show
Series "glx: make sure contexts are destroyed before we exit the test" ( rev: 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Timothy Arceri April 12, 2019, 6:23 a.m.
Without this the last two contexts that are created will not
have been destroyed when exiting the test. This creates a race
condition in Mesa between any threads that might be using
glsl_types and the atexit() callback that destroys these types.
---
 tests/glx/glx-multithread-shader-compile.c | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/tests/glx/glx-multithread-shader-compile.c b/tests/glx/glx-multithread-shader-compile.c
index f24e1761f..1e428da22 100644
--- a/tests/glx/glx-multithread-shader-compile.c
+++ b/tests/glx/glx-multithread-shader-compile.c
@@ -87,6 +87,7 @@  thread_func(void *arg)
 		glUseProgram(program);
 		piglit_check_gl_error(GL_NO_ERROR);
 
+		glXMakeCurrent(dpy, None, None);
 		glXDestroyContext(dpy, ctx);
 	}
 

Comments


On Fri, 2019-04-12 at 16:23 +1000, Timothy Arceri wrote:
> Without this the last two contexts that are created will not
> have been destroyed when exiting the test. This creates a race
> condition in Mesa between any threads that might be using
> glsl_types and the atexit() callback that destroys these types.

Super minor nit: the commit summary line should perhaps say "unbound"
not "destroyed", since this change is not destroying them, simply
making sure that glXDestroyContext _will_ destroy them.

- ajax