mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-06 07:20:48 +00:00
Fixed deadlock when shutting down the Windows joystick system
This commit is contained in:
parent
371735e95b
commit
92d3fc4883
3 changed files with 15 additions and 7 deletions
|
@ -429,7 +429,12 @@ SDL_StopJoystickThread(void)
|
|||
SDL_CondBroadcast(s_condJoystickThread); /* signal the joystick thread to quit */
|
||||
SDL_UnlockMutex(s_mutexJoyStickEnum);
|
||||
PostThreadMessage(SDL_GetThreadID(s_joystickThread), WM_QUIT, 0, 0);
|
||||
|
||||
/* Unlock joysticks while the joystick thread finishes processing messages */
|
||||
SDL_AssertJoysticksLocked();
|
||||
SDL_UnlockJoysticks();
|
||||
SDL_WaitThread(s_joystickThread, NULL); /* wait for it to bugger off */
|
||||
SDL_LockJoysticks();
|
||||
|
||||
SDL_DestroyCond(s_condJoystickThread);
|
||||
s_condJoystickThread = NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue