mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-01 23:07:45 +08:00
Removed timeout in SDL_RunOnMainThread()
Fixes https://github.com/libsdl-org/SDL/issues/12923
This commit is contained in:
@@ -1400,9 +1400,7 @@ bool SDL_RunOnMainThread(SDL_MainThreadCallback callback, void *userdata, bool w
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Maximum wait of 30 seconds to prevent deadlocking forever
|
SDL_WaitSemaphore(entry->semaphore);
|
||||||
const Sint32 MAX_CALLBACK_WAIT = 30 * 1000;
|
|
||||||
SDL_WaitSemaphoreTimeout(entry->semaphore, MAX_CALLBACK_WAIT);
|
|
||||||
|
|
||||||
switch (SDL_GetAtomicInt(&entry->state)) {
|
switch (SDL_GetAtomicInt(&entry->state)) {
|
||||||
case SDL_MAIN_CALLBACK_COMPLETE:
|
case SDL_MAIN_CALLBACK_COMPLETE:
|
||||||
|
|||||||
Reference in New Issue
Block a user