diff options
Diffstat (limited to 'platform/linuxbsd')
-rw-r--r-- | platform/linuxbsd/display_server_x11.cpp | 4 | ||||
-rw-r--r-- | platform/linuxbsd/display_server_x11.h | 2 | ||||
-rw-r--r-- | platform/linuxbsd/joypad_linux.cpp | 6 | ||||
-rw-r--r-- | platform/linuxbsd/joypad_linux.h | 2 |
4 files changed, 7 insertions, 7 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 diff --git a/platform/linuxbsd/display_server_x11.h b/platform/linuxbsd/display_server_x11.h index 906710f933..10686d8424 100644 --- a/platform/linuxbsd/display_server_x11.h +++ b/platform/linuxbsd/display_server_x11.h @@ -253,7 +253,7 @@ class DisplayServerX11 : public DisplayServer { mutable Mutex events_mutex; Thread events_thread; - bool events_thread_done = false; + SafeFlag events_thread_done; LocalVector<XEvent> polled_events; static void _poll_events_thread(void *ud); bool _wait_for_events() const; diff --git a/platform/linuxbsd/joypad_linux.cpp b/platform/linuxbsd/joypad_linux.cpp index 9d2a768fb3..fc818a478d 100644 --- a/platform/linuxbsd/joypad_linux.cpp +++ b/platform/linuxbsd/joypad_linux.cpp @@ -87,7 +87,7 @@ JoypadLinux::JoypadLinux(Input *in) { } JoypadLinux::~JoypadLinux() { - exit_monitor = true; + exit_monitor.set(); joy_thread.wait_to_finish(); close_joypad(); } @@ -155,7 +155,7 @@ void JoypadLinux::monitor_joypads(udev *p_udev) { udev_monitor_enable_receiving(mon); int fd = udev_monitor_get_fd(mon); - while (!exit_monitor) { + while (!exit_monitor.is_set()) { fd_set fds; struct timeval tv; int ret; @@ -197,7 +197,7 @@ void JoypadLinux::monitor_joypads(udev *p_udev) { #endif void JoypadLinux::monitor_joypads() { - while (!exit_monitor) { + while (!exit_monitor.is_set()) { { MutexLock lock(joy_mutex); diff --git a/platform/linuxbsd/joypad_linux.h b/platform/linuxbsd/joypad_linux.h index 2cca0700d6..b0d0db047b 100644 --- a/platform/linuxbsd/joypad_linux.h +++ b/platform/linuxbsd/joypad_linux.h @@ -73,7 +73,7 @@ private: #ifdef UDEV_ENABLED bool use_udev = false; #endif - bool exit_monitor = false; + SafeFlag exit_monitor; Mutex joy_mutex; Thread joy_thread; Input *input = nullptr; |