summaryrefslogtreecommitdiff
path: root/vcl/source/app/timer.cxx
diff options
context:
space:
mode:
authorJuergen Funk <juergen.funk_ml@cib.de>2015-06-03 09:23:44 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2015-06-12 15:19:20 +0000
commit1289d3c42af66990a2c8e5a7a38e51b6cd51c7eb (patch)
tree5891add77480cc9b19edb4ccabe7061446a5c9cc /vcl/source/app/timer.cxx
parentbeb8e2830dc9e1c771e196fcaf08cdfd6bf3dde3 (diff)
std::list for Scheduler
Re-factor the scheduler to use std::list Because - ImplSchedulerData - remove: mbInScheduler, mnUpdateTime, mnUpdateStack that is scheduler stuff - this struct is only a container for the scheduler-list - UpdateMinPeriod - the scheduler is the pure-virtual-class then the idle-class must override this method - ImplDeInitScheduler(bool All=true) - this patch 2e29a518b04250b5f9cc9d0d77da3df076834d60 remove all scheduler tasks and the scheduler, but after that, the scheduler is using, then crash. With this fix, only delete the scheduler-list, but not the scheduler The next steps - split the scheduler from the scheduler-list-handling the scheduler-list-handling need a static class - remove the scheduler from the timer-handling staff Change-Id: I8d4d4f27b2bc9684a48c2afafd0b3edd0716c71d Reviewed-on: https://gerrit.libreoffice.org/16148 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'vcl/source/app/timer.cxx')
-rw-r--r--vcl/source/app/timer.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/vcl/source/app/timer.cxx b/vcl/source/app/timer.cxx
index 7d92283b6466..b6c2abaacb6f 100644
--- a/vcl/source/app/timer.cxx
+++ b/vcl/source/app/timer.cxx
@@ -23,7 +23,6 @@
#include <svdata.hxx>
#include <salinst.hxx>
-#define MAX_TIMER_PERIOD SAL_MAX_UINT64
void Timer::ImplStartTimer( ImplSVData* pSVData, sal_uInt64 nMS )
{
@@ -45,23 +44,23 @@ void Timer::SetDeletionFlags()
// if no AutoTimer than stop
if ( !mbAuto )
{
- mpSchedulerData->mbDelete = true;
- mbActive = false;
+ Scheduler::SetDeletionFlags();
}
}
bool Timer::ReadyForSchedule( bool bTimer )
{
(void)bTimer;
- return (mpSchedulerData->mnUpdateTime + mnTimeout) <= tools::Time::GetSystemTicks();
+ return (mnUpdateTime + mnTimeout) <= tools::Time::GetSystemTicks();
}
sal_uInt64 Timer::UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 nTime )
{
sal_uInt64 nNewTime = tools::Time::GetSystemTicks();
sal_uInt64 nDeltaTime;
+
//determine smallest time slot
- if( mpSchedulerData->mnUpdateTime == nTime )
+ if( mnUpdateTime == nTime )
{
nDeltaTime = mnTimeout;
if( nDeltaTime < nMinPeriod )
@@ -69,7 +68,7 @@ sal_uInt64 Timer::UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 nTime )
}
else
{
- nDeltaTime = mpSchedulerData->mnUpdateTime + mnTimeout;
+ nDeltaTime = mnUpdateTime + mnTimeout;
if( nDeltaTime < nNewTime )
nMinPeriod = 1;
else