Wake the main thread for main function dispatch
Also added a test case to catch the main thread waiting indefinitely when a function is pending. Fixes https://github.com/libsdl-org/SDL/issues/12390
This commit is contained in:
@@ -1371,6 +1371,9 @@ bool SDL_RunOnMainThread(SDL_MainThreadCallback callback, void *userdata, bool w
|
||||
}
|
||||
SDL_UnlockMutex(SDL_main_callbacks_lock);
|
||||
|
||||
// If the main thread is waiting for events, wake it up
|
||||
SDL_SendWakeupEvent();
|
||||
|
||||
if (!wait_complete) {
|
||||
// Queued for execution, wait not requested
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user