Well I have read at various places that the pygame event handling must be done in the main thread. I want to do that but my question is, can I add events to the event queue
Time for some detective work!
Looking at the source for event_post
in event.c indicates that the C function uses the SDL call SDL_PushEvent
, without checking for thread-safety on its own. However, the documentation for SDL_PushEvent says:
This function is thread safe, and can be called from other threads safely.
So it seems that it is indeed thread-safe.