| Summary: | event queue | ||
|---|---|---|---|
| Product: | SDL | Reporter: | sage <2132494320> |
| Component: | events | Assignee: | Sam Lantinga <slouken> |
| Status: | WAITING --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | 2132494320, sylvain.becker |
| Version: | 2.0.4 | ||
| Hardware: | x86_64 | ||
| OS: | Windows 7 | ||
|
Description
sage
2016-07-05 03:10:31 UTC
Can you attach your test program so we can replicate this here? Thanks! Just looking at the bug report, it seems because SDL_PushEvent() is doing: First: getting the timestamp: event->common.timestamp = SDL_GetTicks(); Then: locking the queue and pushing the event. If there is several threads pushing events, the issue can occur. For instance: thread-1: getting the timestamp1 thread-2: getting the timestamp2 thread-2: pushing the event with timestamp2 thread-1: pushing the event with timestamp1 several solutions: - put the timestamp once you have locked the queue, but it may be older then. or - insert in the middle of queue. But user might have already read the queueu ... or - discard the event ... or - implement double timestamp: native and when pushing. see bug 2011 or - just don't expect event be timestamp order in that case ... |