You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
This race condition made me pull my hair. `wl_display_roundtrip` has its own little event loop, which apparently conflicts hard with the always-running event loop thread. I kinda assumed that it would be thread-safe thanks to its internal `wl_display_prepare_read` call that the docs talk about but that's clearly not enough. Luckily this method is called very few times and the only dangerous instances are in the initialization routine, which first starts the thread and then does various roundtrips. Libdecor has also some internal roundtrips of its own which would often fail. Starting the thread after all initialization fixes the issue. Tested this by spamming *lots* of `wl_display_roundtrip` in `WaylandThread::init()` with and without this fix.
164 KiB
164 KiB