1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00
Files
godot/platform/linuxbsd
Dery Almas ab205a78ce Wayland: defer event thread initialization to late initialization
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.
2025-10-10 23:25:00 +02:00
..
2025-10-10 04:31:14 -05:00
2025-10-10 04:31:14 -05:00

Linux/*BSD platform port

This folder contains the C++ code for the Linux/*BSD platform port.

See also misc/dist/linux folder for additional files used by this platform.

Documentation

Artwork license

logo.svg is derived from the Linux logo:

Permission to use and/or modify this image is granted provided you acknowledge me lewing@isc.tamu.edu and The GIMP if someone asks.