diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2017-07-24 15:45:32 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2017-07-24 18:05:07 +0200 |
commit | 4815b6f7c70cca5a226163caaaab8a227f32be48 (patch) | |
tree | b4218e217c7ebe8d2c78cb24a430b64baa207efc /vcl | |
parent | 9dfd1bb102bb08f0651a6921722d731ab973bd08 (diff) |
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
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/win/app/salinst.cxx | 2 | ||||
-rw-r--r-- | vcl/win/app/saltimer.cxx | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx index 8e718e37e883..cfffb97d0234 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 ae8ed0790bf5..4ca5ebb572d2 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; |