Kaydet (Commit) cd1d5f35 authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski

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
üst f0dae5fb
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment