Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SDL: Call multiplayer->update() from the user code thread
The multiplayer update scans for messages and passes them in to the user defined function on_message(). This should be done in the user code thread for two reasons: 1. Calling it from a different thread means on_message() and update() are being run in different threads, and therefore all code in both of them has to be thread safe. This is pretty hard to do with the 32blit API and not really in the spirit of what this is supposed to be. 2. on_message() is a user-supplied function and so bugs can make it hang. We can detect hangs in update() and render() thanks to running them on the user thread (via blit::tick()). Running on_message() on that thread allows to detect hangs there too.
- Loading branch information