diff options
author | Milian Wolff <milian.wolff@kdab.com> | 2017-12-18 16:48:19 +0100 |
---|---|---|
committer | Milian Wolff <milian.wolff@kdab.com> | 2017-12-19 09:36:11 +0000 |
commit | e2c10e99dba1d3e0cf047a103518722b2a0eab58 (patch) | |
tree | e41956735d76f555773725cf3a7c925e60aceec7 /src/plugins | |
parent | 152033bec09c8a57b46a01488cff1a88ca61da33 (diff) |
Cleanup: Use QThread::msleep to sleep instead of select
The old code used select with all-zero parameters and a timeval struct
configured to wait for 50ms. This can be drastically simplified by just
calling QThread::msleep which makes the intention much more clear.
Change-Id: I115b56ae67ae2c2cd03354e16a7bfdf56f8c15b8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbclipboard.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/plugins/platforms/xcb/qxcbclipboard.cpp b/src/plugins/platforms/xcb/qxcbclipboard.cpp index 30ab669432..b091928e8c 100644 --- a/src/plugins/platforms/xcb/qxcbclipboard.cpp +++ b/src/plugins/platforms/xcb/qxcbclipboard.cpp @@ -899,10 +899,7 @@ xcb_generic_event_t *QXcbClipboard::waitForClipboardEvent(xcb_window_t win, int connection()->flush(); // sleep 50 ms, so we don't use up CPU cycles all the time. - struct timeval usleep_tv; - usleep_tv.tv_sec = 0; - usleep_tv.tv_usec = 50000; - select(0, 0, 0, 0, &usleep_tv); + QThread::msleep(50); } while (timer.elapsed() < timeout); return 0; |