mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-20 16:31:57 +09:00
[Fix, Test] (MG_Test, MG_Test/Backend, MG_Test/BackendLoader, MG_Test/Buffer, MG_Test/EGLState, MG_Test/Framebuffer, MG_Test/Gbm, MG_Test/Pipe, MG_Test/Pipeline, MG_Test/Program, MG_Test/Query, MG_Test/SelfTest, MG_Test/ShaderTranspiler, MG_Test/State, MG_Test/Swapchain, MG_Test/Texture, MG_Test/Util, MG_Test/VertexArray, MG_Test/Wire, MG_Util/Async): drain shader compile workers before a test's main returns
- On MSVC the atexit drain deadlocked with a worker registering a static's destructor, hanging the shader tests on Windows.
This commit is contained in:
@@ -53,7 +53,10 @@ namespace MobileGL::MG_Util::Async {
|
||||
// it just also has to happen for a process that exits without ever
|
||||
// calling eglTerminate, which is the norm for a test binary and legal
|
||||
// for an application. Registered here, during main, so it runs before
|
||||
// the destructors of statics constructed at load time.
|
||||
// the destructors of statics constructed at load time. The MSVC runtime
|
||||
// runs this under its exit lock, so a worker that constructs a static for
|
||||
// the first time meanwhile deadlocks: a program linking MobileGL statically
|
||||
// drains before main returns, as MG_Test's TestMain.cpp does.
|
||||
ShaderCompilePool::StopAndDrainProcessPoolAtExit();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user