| Summary: | SDL_WaitEvent() randomly stalls with events pending (2.0.10 regression) | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Andrew Church <achurch+sdl> |
| Component: | events | Assignee: | Ryan C. Gordon <icculus> |
| Status: | ASSIGNED --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | CC: | sezeroz |
| Version: | 2.0.10 | Keywords: | target-2.0.10 |
| Hardware: | x86_64 | ||
| OS: | Linux | ||
Ryan, can you look at this ASAP? |
In SDL 2.0.10, SDL_WaitEvent() can stall for a short but noticeable period of time (200-300ms?) even while events are pending. I observed this as seeing joystick input seem to drop out once every few seconds using a udev-based controller (specifically a Sony DualShock 3). This does not occur in SDL 2.0.9. Sample code (spin an analog stick and watch for the event counter to pause): ----------------------------------------------------- #include <assert.h> #include <stdio.h> #include <SDL2/SDL.h> int main(void) { int counter = 0; SDL_Init(SDL_INIT_EVERYTHING); assert(SDL_NumJoysticks() >= 1); SDL_Joystick *js = SDL_JoystickOpen(0); assert(js); for (;;) { SDL_Event event; SDL_WaitEvent(&event); printf("event %d\n", counter++); } } -----------------------------------------------------