summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2016-09-06 10:44:05 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2017-01-17 16:08:47 +0100
commit17bb38262471cf68167fa11ad875c2785f43a341 (patch)
treeb45164db62a513cbf0a896d32e74eede96a9ac02
parent9ec3b1e1bfd38a7a26b8f22024b0d62f771fd5a5 (diff)
Convert bTimer => bIdle
All other places already refer to being Idle, so change the Scheduler::ProcessTaskScheduling argument to bIdle and adapt all other scheduler-related functions. Change-Id: If5a605abbc3e620092127b65ada29f11215a0343
-rw-r--r--include/vcl/idle.hxx2
-rw-r--r--include/vcl/scheduler.hxx4
-rw-r--r--include/vcl/timer.hxx2
-rw-r--r--vcl/inc/saltimer.hxx2
-rw-r--r--vcl/qa/cppunit/lifecycle.cxx2
-rw-r--r--vcl/qa/cppunit/timer.cxx2
-rw-r--r--vcl/source/app/idle.cxx4
-rw-r--r--vcl/source/app/scheduler.cxx14
-rw-r--r--vcl/source/app/svapp.cxx4
-rw-r--r--vcl/source/app/timer.cxx2
10 files changed, 18 insertions, 20 deletions
diff --git a/include/vcl/idle.hxx b/include/vcl/idle.hxx
index 5a33e2e70ba9..d3fdfbb5f78e 100644
--- a/include/vcl/idle.hxx
+++ b/include/vcl/idle.hxx
@@ -28,7 +28,7 @@ class VCL_DLLPUBLIC Idle : public Scheduler
Link<Idle *, void> maIdleHdl; // Callback Link
protected:
- virtual bool ReadyForSchedule( bool bTimerOnly, sal_uInt64 nTimeNow ) const override;
+ virtual bool ReadyForSchedule( bool bIdle, sal_uInt64 nTimeNow ) const override;
virtual bool IsIdle() const override;
virtual sal_uInt64 UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 nTimeNow ) const override;
diff --git a/include/vcl/scheduler.hxx b/include/vcl/scheduler.hxx
index ef6949de1654..16aba06a4b59 100644
--- a/include/vcl/scheduler.hxx
+++ b/include/vcl/scheduler.hxx
@@ -54,7 +54,7 @@ protected:
friend struct ImplSchedulerData;
virtual void SetDeletionFlags();
/// Is this item ready to be dispatched at nTimeNow
- virtual bool ReadyForSchedule( bool bTimerOnly, sal_uInt64 nTimeNow ) const = 0;
+ virtual bool ReadyForSchedule( bool bIdle, sal_uInt64 nTimeNow ) const = 0;
/// Schedule only when other timers and events are processed
virtual bool IsIdle() const = 0;
/**
@@ -90,7 +90,7 @@ public:
/// Calculate minimum timeout - and return its value.
static sal_uInt64 CalculateMinimumTimeout( bool &bHasActiveIdles );
/// Process one pending task ahead of time with highest priority.
- static bool ProcessTaskScheduling( bool bTimerOnly );
+ static bool ProcessTaskScheduling( bool bIdle );
/// Process all events until we are idle
static void ProcessEventsToIdle();
diff --git a/include/vcl/timer.hxx b/include/vcl/timer.hxx
index c1ede8c83caf..ff79acde2936 100644
--- a/include/vcl/timer.hxx
+++ b/include/vcl/timer.hxx
@@ -31,7 +31,7 @@ protected:
bool mbAuto;
virtual void SetDeletionFlags() override;
- virtual bool ReadyForSchedule( bool bTimerOnly, sal_uInt64 nTimeNow ) const override;
+ virtual bool ReadyForSchedule( bool bIdle, sal_uInt64 nTimeNow ) const override;
virtual bool IsIdle() const override;
virtual sal_uInt64 UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 nTimeNow ) const override;
diff --git a/vcl/inc/saltimer.hxx b/vcl/inc/saltimer.hxx
index 72b1eb8e14fa..c2e2c2300f30 100644
--- a/vcl/inc/saltimer.hxx
+++ b/vcl/inc/saltimer.hxx
@@ -70,7 +70,7 @@ struct ImplSchedulerData
void Invoke();
const char *GetDebugName() const;
- static ImplSchedulerData *GetMostImportantTask( bool bTimerOnly, sal_uInt64 nTimeNow );
+ static ImplSchedulerData *GetMostImportantTask( bool bIdle, sal_uInt64 nTimeNow );
};
#endif // INCLUDED_VCL_INC_SALTIMER_HXX
diff --git a/vcl/qa/cppunit/lifecycle.cxx b/vcl/qa/cppunit/lifecycle.cxx
index 67f2e9bce9db..b3a73af757a3 100644
--- a/vcl/qa/cppunit/lifecycle.cxx
+++ b/vcl/qa/cppunit/lifecycle.cxx
@@ -211,7 +211,7 @@ void LifecycleTest::testFocus()
xWin->Show();
xChild->GrabFocus();
// process asynchronous ToTop
- Scheduler::ProcessTaskScheduling(false);
+ Scheduler::ProcessTaskScheduling( true );
// FIXME: really awful to test focus issues without showing windows.
// CPPUNIT_ASSERT(xChild->HasFocus());
}
diff --git a/vcl/qa/cppunit/timer.cxx b/vcl/qa/cppunit/timer.cxx
index ca7a0284e91a..3bf387dcb950 100644
--- a/vcl/qa/cppunit/timer.cxx
+++ b/vcl/qa/cppunit/timer.cxx
@@ -117,7 +117,7 @@ void TimerTest::testIdle()
{
bool bTriggered = false;
IdleBool aTest( bTriggered );
- Scheduler::ProcessTaskScheduling(false);
+ Scheduler::ProcessTaskScheduling( true );
CPPUNIT_ASSERT_MESSAGE("idle triggered", bTriggered);
}
diff --git a/vcl/source/app/idle.cxx b/vcl/source/app/idle.cxx
index faf499ed440b..dea322fd5db9 100644
--- a/vcl/source/app/idle.cxx
+++ b/vcl/source/app/idle.cxx
@@ -63,10 +63,10 @@ void Idle::Start()
Scheduler::ImplStartTimer(nPeriod);
}
-bool Idle::ReadyForSchedule( bool bTimerOnly, sal_uInt64 /* nTimeNow */ ) const
+bool Idle::ReadyForSchedule( bool bIdle, sal_uInt64 /* nTimeNow */ ) const
{
// always ready if not only looking for timers.
- return !bTimerOnly;
+ return bIdle;
}
bool Idle::IsIdle() const
diff --git a/vcl/source/app/scheduler.cxx b/vcl/source/app/scheduler.cxx
index cc4e14ac4a1d..63c0c5fcafc6 100644
--- a/vcl/source/app/scheduler.cxx
+++ b/vcl/source/app/scheduler.cxx
@@ -49,7 +49,7 @@ void ImplSchedulerData::Invoke()
mbInScheduler = false;
}
-ImplSchedulerData *ImplSchedulerData::GetMostImportantTask( bool bTimerOnly, sal_uInt64 nTimeNow )
+ImplSchedulerData *ImplSchedulerData::GetMostImportantTask( bool bIdle, sal_uInt64 nTimeNow )
{
ImplSVData* pSVData = ImplGetSVData();
ImplSchedulerData *pMostUrgent = nullptr;
@@ -57,7 +57,7 @@ ImplSchedulerData *ImplSchedulerData::GetMostImportantTask( bool bTimerOnly, sal
for ( ImplSchedulerData *pSchedulerData = pSVData->mpFirstSchedulerData; pSchedulerData; pSchedulerData = pSchedulerData->mpNext )
{
if ( !pSchedulerData->mpScheduler || pSchedulerData->mbDelete || pSchedulerData->mbInScheduler ||
- !pSchedulerData->mpScheduler->ReadyForSchedule( bTimerOnly, nTimeNow ) ||
+ !pSchedulerData->mpScheduler->ReadyForSchedule( bIdle, nTimeNow ) ||
!pSchedulerData->mpScheduler->IsActive())
continue;
if (!pMostUrgent)
@@ -164,20 +164,20 @@ void InitSystemTimer(ImplSVData* pSVData)
}
-void Scheduler::CallbackTaskScheduling(bool)
+void Scheduler::CallbackTaskScheduling( bool bIdle )
{
// this function is for the saltimer callback
- Scheduler::ProcessTaskScheduling( false );
+ Scheduler::ProcessTaskScheduling( bIdle );
}
-bool Scheduler::ProcessTaskScheduling( bool bTimerOnly )
+bool Scheduler::ProcessTaskScheduling( bool bIdle )
{
ImplSchedulerData* pSchedulerData;
sal_uInt64 nTime = tools::Time::GetSystemTicks();
DBG_TESTSOLARMUTEX();
- if ((pSchedulerData = ImplSchedulerData::GetMostImportantTask(bTimerOnly, nTime)))
+ if ((pSchedulerData = ImplSchedulerData::GetMostImportantTask(bIdle, nTime)))
{
SAL_INFO("vcl.schedule", "Invoke task " << pSchedulerData->GetDebugName());
@@ -203,8 +203,6 @@ bool Scheduler::GetDeterministicMode()
sal_uInt64 Scheduler::CalculateMinimumTimeout( bool &bHasActiveIdles )
{
- // process all pending Tasks
- // if bTimer True, only handle timer
ImplSchedulerData* pSchedulerData = nullptr;
ImplSchedulerData* pPrevSchedulerData = nullptr;
ImplSVData* pSVData = ImplGetSVData();
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index f723527acd25..a6a5430c36d3 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -515,7 +515,7 @@ 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);
+ Scheduler::ProcessTaskScheduling(eResult != SalYieldResult::EVENT);
}
// flush lazy deleted objects
@@ -535,7 +535,7 @@ void Application::Reschedule( bool i_bAllEvents )
void Scheduler::ProcessEventsToIdle()
{
int nSanity = 1000;
- while(Scheduler::ProcessTaskScheduling(false) ||
+ while(Scheduler::ProcessTaskScheduling( true ) ||
ImplYield(false, false, 0))
{
if (nSanity-- < 0)
diff --git a/vcl/source/app/timer.cxx b/vcl/source/app/timer.cxx
index aabfbb28a211..8f52e174e5aa 100644
--- a/vcl/source/app/timer.cxx
+++ b/vcl/source/app/timer.cxx
@@ -31,7 +31,7 @@ void Timer::SetDeletionFlags()
}
}
-bool Timer::ReadyForSchedule( bool /* bTimerOnly */, sal_uInt64 nTimeNow ) const
+bool Timer::ReadyForSchedule( bool /* bIdle */, sal_uInt64 nTimeNow ) const
{
return (mpSchedulerData->mnUpdateTime + mnTimeout) <= nTimeNow;
}