mirror of https://github.com/encounter/SDL.git
Make sure we're not starving report reads when there's lots of rumble
This commit is contained in:
parent
223af86c62
commit
480c1f9fef
|
@ -25,6 +25,7 @@
|
||||||
/* Handle rumble on a separate thread so it doesn't block the application */
|
/* Handle rumble on a separate thread so it doesn't block the application */
|
||||||
|
|
||||||
#include "SDL_thread.h"
|
#include "SDL_thread.h"
|
||||||
|
#include "SDL_timer.h"
|
||||||
#include "SDL_hidapijoystick_c.h"
|
#include "SDL_hidapijoystick_c.h"
|
||||||
#include "SDL_hidapi_rumble.h"
|
#include "SDL_hidapi_rumble.h"
|
||||||
#include "../../thread/SDL_systhread.h"
|
#include "../../thread/SDL_systhread.h"
|
||||||
|
@ -81,6 +82,9 @@ static int SDL_HIDAPI_RumbleThread(void *data)
|
||||||
SDL_UnlockMutex(request->device->dev_lock);
|
SDL_UnlockMutex(request->device->dev_lock);
|
||||||
(void)SDL_AtomicDecRef(&request->device->rumble_pending);
|
(void)SDL_AtomicDecRef(&request->device->rumble_pending);
|
||||||
SDL_free(request);
|
SDL_free(request);
|
||||||
|
|
||||||
|
/* Make sure we're not starving report reads when there's lots of rumble */
|
||||||
|
SDL_Delay(10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue