From e2c10e99dba1d3e0cf047a103518722b2a0eab58 Mon Sep 17 00:00:00 2001 From: Milian Wolff Date: Mon, 18 Dec 2017 16:48:19 +0100 Subject: 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 Reviewed-by: Gatis Paeglis --- src/plugins/platforms/xcb/qxcbclipboard.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/plugins') 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; -- cgit v1.2.3