summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2017-07-17 14:10:16 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2017-07-17 14:19:46 +0200
commitcd1d5f35cb0f9c455787819de56e24cd51e6c5cc (patch)
treee2255cc1555503441a3b39c71b097f87b9e81dc7
parentf0dae5fb2b0628659a121ca3f9ee9bf9039a49dd (diff)
WIN revert to Sleep(1) for yield
There are multiple ways on Windows to yield a thread: * SwitchToThread: yields to any thread on same processor * Sleep(0): yields to any thread of same or higher priority on any processor * Sleep(1): yields to any thread on any processor So we stay with Sleep(1), as it also seems the only call, which actually does some sleep and is not a busy wait. Change-Id: I85c69b2f32dba9869bbddc1a572b3a63c366c5d1
-rw-r--r--vcl/win/app/salinst.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx
index 3a1522f7e836..3b29cf820b01 100644
--- a/vcl/win/app/salinst.cxx
+++ b/vcl/win/app/salinst.cxx
@@ -618,7 +618,7 @@ bool WinSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong
// #i18883# only sleep if potential deadlock scenario, ie, when a dialog is open
if( ImplGetSVData()->maAppData.mnModalMode )
- SwitchToThread();
+ Sleep(1);
else
bDidWork = SendMessageW( mhComWnd, SAL_MSG_THREADYIELD, (WPARAM)bWait, (LPARAM)bHandleAllCurrentEvents );