diff options
| author | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2021-02-10 19:22:13 +0100 |
|---|---|---|
| committer | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2021-02-18 17:12:46 +0100 |
| commit | 8e128726f0eac1982aa75a005554ee5b556b332e (patch) | |
| tree | 827c2f478e8fb3196ef411f4941fa4e839642e31 /platform/linuxbsd/display_server_x11.cpp | |
| parent | 8870f43d742e0c48ae543d999856f5989170b62d (diff) | |
| download | redot-engine-8e128726f0eac1982aa75a005554ee5b556b332e.tar.gz | |
Modernize atomics
- Based on C++11's `atomic`
- Reworked `SafeRefCount` (based on the rewrite by @hpvb)
- Replaced free atomic functions by the new `SafeNumeric<T>`
- Replaced wrong cases of `volatile bool` by the new `SafeFlag`
- Platform-specific implementations no longer needed
Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
Diffstat (limited to 'platform/linuxbsd/display_server_x11.cpp')
| -rw-r--r-- | platform/linuxbsd/display_server_x11.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/platform/linuxbsd/display_server_x11.cpp b/platform/linuxbsd/display_server_x11.cpp index 53baf17858..fceeb82325 100644 --- a/platform/linuxbsd/display_server_x11.cpp +++ b/platform/linuxbsd/display_server_x11.cpp @@ -2697,7 +2697,7 @@ bool DisplayServerX11::_wait_for_events() const { } void DisplayServerX11::_poll_events() { - while (!events_thread_done) { + while (!events_thread_done.is_set()) { _wait_for_events(); // Process events from the queue. @@ -4279,7 +4279,7 @@ DisplayServerX11::~DisplayServerX11() { _clipboard_transfer_ownership(XA_PRIMARY, x11_main_window); _clipboard_transfer_ownership(XInternAtom(x11_display, "CLIPBOARD", 0), x11_main_window); - events_thread_done = true; + events_thread_done.set(); events_thread.wait_to_finish(); //destroy all windows |
