include/vcl/scheduler.hxx    |    3 ++-
 vcl/source/app/scheduler.cxx |    6 ++++--
 vcl/source/app/svapp.cxx     |    7 ++++---
 3 files changed, 10 insertions(+), 6 deletions(-)

New commits:
commit 46e0fb8714b747f1d710673c56d96bf9c3352913
Author: László Németh <laszlo.nem...@collabora.com>
Date:   Tue Apr 5 16:09:11 2016 +0200

    limit event processing for processEventsToIdle
    
    Change-Id: I92afc6c5564977ce4dbbd3b01fb481a0ccc7123a

diff --git a/include/vcl/scheduler.hxx b/include/vcl/scheduler.hxx
index a5f4059..e9de235 100644
--- a/include/vcl/scheduler.hxx
+++ b/include/vcl/scheduler.hxx
@@ -96,7 +96,8 @@ public:
     static sal_uInt64 CalculateMinimumTimeout( bool &bHasActiveIdles,
                                                bool  bIgnoreLowPriority = 
false );
     /// Process one pending task ahead of time with highest priority.
-    static bool       ProcessTaskScheduling( bool bTimerOnly );
+    static bool       ProcessTaskScheduling( bool bTimerOnly, bool 
bEnableDisabledScheduler = false );
+
     /// Process all events until we are idle
     static void       ProcessEventsToIdle();
 };
diff --git a/vcl/source/app/scheduler.cxx b/vcl/source/app/scheduler.cxx
index 9cc8669..a1cd3f3 100644
--- a/vcl/source/app/scheduler.cxx
+++ b/vcl/source/app/scheduler.cxx
@@ -157,12 +157,14 @@ void Scheduler::CallbackTaskScheduling(bool ignore)
     Scheduler::ProcessTaskScheduling( false );
 }
 
-bool Scheduler::ProcessTaskScheduling( bool bTimerOnly )
+bool Scheduler::ProcessTaskScheduling( bool bTimerOnly, bool 
bEnableDisabledScheduler )
 {
     ImplSchedulerData* pSchedulerData;
 
     // tdf#91727 - NB. bTimerOnly is ultimately not used
-    if ((pSchedulerData = ImplSchedulerData::GetMostImportantTask(bTimerOnly)))
+    static bool bDisabledScheduler = !!getenv("SAL_DISABLE_SCHEDULER");
+
+    if ((!bDisabledScheduler || bEnableDisabledScheduler) && (pSchedulerData = 
ImplSchedulerData::GetMostImportantTask(bTimerOnly)))
     {
         SAL_INFO("vcl.schedule", "Invoke task " << 
pSchedulerData->GetDebugName());
 
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index c9c2101..fb5be8e 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -473,7 +473,8 @@ void Application::Execute()
     pSVData->maAppData.mbInAppExecute = false;
 }
 
-inline bool ImplYield(bool i_bWait, bool i_bAllEvents, sal_uLong const 
nReleased, bool bIgnoreLowPrio = false)
+inline bool ImplYield(bool i_bWait, bool i_bAllEvents, sal_uLong const 
nReleased, bool bIgnoreLowPrio = false, bool bEnableDisabledScheduler = false )
+
 {
     ImplSVData* pSVData = ImplGetSVData();
 
@@ -516,7 +517,7 @@ inline bool ImplYield(bool i_bWait, bool i_bAllEvents, 
sal_uLong const nReleased
     DBG_TESTSOLARMUTEX(); // must be locked on return from Yield
 
     // Process all Tasks
-    Scheduler::ProcessTaskScheduling(eResult == SalYieldResult::EVENT);
+    Scheduler::ProcessTaskScheduling(eResult == SalYieldResult::EVENT, 
bEnableDisabledScheduler);
 
     // flush lazy deleted objects
     if( pSVData->maAppData.mnDispatchLevel == 0 )
@@ -535,7 +536,7 @@ void Application::Reschedule( bool i_bAllEvents )
 void Scheduler::ProcessEventsToIdle()
 {
     int nSanity = 100;
-    while(ImplYield(false, true, 0, true))
+    while(ImplYield(false, true, 0, true, true))
     {
         if (nSanity-- < 0)
         {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to