Skip to content

llvmpipe: Don't wait for already-terminated threads on Windows

Jesse Natalie requested to merge jenatali/mesa:osmesa-llvmpipe-hang-fix into main

In the case of an app returning from main(), Windows will apparently terminate other threads before invoking final cleanup on the main thread.

llvmpipe can't wait for threads to signal a semaphore if the thread is already gone. Since we're already in a WIN32 special case, just call the Win32 API to check if the thread is terminated or STILL_ALIVE.

Fixes the hang preventing !8672 (merged) from merging.

/cc @airlied

/cc @jrfonseca since I see you fixed the previous llvmpipe cleanup hang on Windows.

Merge request reports