WIN don't yield the scheduler in PeekMessage
The scheduler is restarting the timer at the end of the most
important task search. It uses PeekMessage PM_REMOVE to remove
old SAL_MSG_TIMER_CALLBACK messages from the queue.
Without PM_NOYIELD, in combination with an other thread yielding
using SAL_MSG_THREADYIELD, this could re-start scheduling inside
these PeekMessage calls, resulting in various assertions inside
the scheduler code, most time due to the changed ascheduler list
in "assert( pPrevSchedulerData->mpNext == pSchedulerData )".
Change-Id: Ia96b6c0e06ffc3126b1428723b53f4b2112f8a5f
diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx
index 8e718e3..cfffb97 100644
--- a/vcl/win/app/salinst.cxx
+++ b/vcl/win/app/salinst.cxx
@@ -730,7 +730,7 @@ LRESULT CALLBACK SalComWndProc( HWND, UINT nMsg, WPARAM wParam, LPARAM lParam, i
case SAL_MSG_TIMER_CALLBACK:
MSG aMsg;
while ( PeekMessageW(&aMsg, nullptr, SAL_MSG_TIMER_CALLBACK,
SAL_MSG_TIMER_CALLBACK, PM_REMOVE) )
SAL_MSG_TIMER_CALLBACK, PM_REMOVE | PM_NOYIELD) )
assert( "Multiple timer messages in queue" );
assert( 0 == wParam );
if ( 0 == wParam )
diff --git a/vcl/win/app/saltimer.cxx b/vcl/win/app/saltimer.cxx
index ae8ed07..4ca5ebb 100644
--- a/vcl/win/app/saltimer.cxx
+++ b/vcl/win/app/saltimer.cxx
@@ -49,7 +49,7 @@ void ImplSalStopTimer()
MSG aMsg;
int nMsgCount = 0;
while ( PeekMessageW(&aMsg, nullptr, SAL_MSG_TIMER_CALLBACK,
SAL_MSG_TIMER_CALLBACK, PM_REMOVE) )
SAL_MSG_TIMER_CALLBACK, PM_REMOVE | PM_NOYIELD) )
nMsgCount++;
assert( nMsgCount <= 1 );
pSalData->mbOnIdleRunScheduler = false;