diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2016-09-08 06:55:30 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2017-07-13 12:10:21 +0200 |
commit | d348035a60361a1b9ba9eb7b67013204a24a6633 (patch) | |
tree | 85e7e4ff2dd926ef9d2907b4f4900815bdbb96c5 /vcl/source/app/svapp.cxx | |
parent | 1782893282a4543e946e6b2c8de863b10fab0c85 (diff) |
Drop special idle handling
Idles are just instant timers, which should most time have a low
priority, By dropping most special idle handling we'll just
schedule by priority.
This also reverts SalYieldResult back to a bool, which just
indicates if any event was processed.
Change-Id: Ia0b91b06dffb77af066f01838d8f9483523bf67d
Diffstat (limited to 'vcl/source/app/svapp.cxx')
-rw-r--r-- | vcl/source/app/svapp.cxx | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 3a5c89850431..a6cad056c27a 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -469,8 +469,7 @@ inline bool ImplYield(bool i_bWait, bool i_bAllEvents, sal_uLong const nReleased SAL_INFO("vcl.schedule", "Enter ImplYield: " << (i_bWait ? "wait" : "no wait") << ": " << (i_bAllEvents ? "all events" : "one event") << ": " << nReleased); - // If we have idles, don't wait for the timeout; check for events - // and come back as quick as possible. + // we handle pending task outside the system event loop, so don't wait if (i_bWait && Scheduler::HasPendingTasks()) i_bWait = false; @@ -482,15 +481,12 @@ inline bool ImplYield(bool i_bWait, bool i_bAllEvents, sal_uLong const nReleased // do not wait for events if application was already quit; in that // case only dispatch events already available - // do not wait for events either if the app decided that it is too busy for timers - // (feature added for the slideshow) - SalYieldResult eResult = + bool bProcessedEvent = pSVData->mpDefInst->DoYield( i_bWait && !pSVData->maAppData.mbAppQuit, i_bAllEvents, nReleased); - SAL_INFO("vcl.schedule", "DoYield returns: " - << (eResult == SalYieldResult::EVENT ? "processed event" : "timeout")); + SAL_INFO("vcl.schedule", "DoYield returns: " << bProcessedEvent ); pSVData->maAppData.mnDispatchLevel--; @@ -499,16 +495,15 @@ inline bool ImplYield(bool i_bWait, bool i_bAllEvents, sal_uLong const nReleased if (nReleased == 0) // tdf#99383 don't run stuff from ReAcquireSolarMutex { // Process all Tasks - Scheduler::ProcessTaskScheduling(eResult != SalYieldResult::EVENT); + bProcessedEvent = Scheduler::ProcessTaskScheduling() || bProcessedEvent; } // flush lazy deleted objects if( pSVData->maAppData.mnDispatchLevel == 0 ) vcl::LazyDelete::flush(); - SAL_INFO("vcl.schedule", "Leave ImplYield"); - - return Scheduler::HasPendingTasks() || eResult == SalYieldResult::EVENT; + SAL_INFO("vcl.schedule", "Leave ImplYield with return " << bProcessedEvent ); + return bProcessedEvent || Scheduler::HasPendingTasks(); } bool Application::Reschedule( bool i_bAllEvents ) @@ -518,7 +513,7 @@ bool Application::Reschedule( bool i_bAllEvents ) void Scheduler::ProcessEventsToSignal(bool& bSignal) { - while(!bSignal && (Scheduler::ProcessTaskScheduling( true ) || + while(!bSignal && (Scheduler::ProcessTaskScheduling() || ImplYield(false, false, 0))) { } @@ -527,8 +522,8 @@ void Scheduler::ProcessEventsToSignal(bool& bSignal) void Scheduler::ProcessEventsToIdle() { int nSanity = 1000; - while(Scheduler::ProcessTaskScheduling( true ) || - ImplYield(false, false, 0)) + while( Scheduler::ProcessTaskScheduling() || + ImplYield(false, true, 0) ) { if (nSanity-- < 0) { |