Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
01f406bc
Kaydet (Commit)
01f406bc
authored
Mar 06, 2015
tarafından
Tobias Madl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
adapted comments and variable names
Change-Id: I4f2c1d743ce2f30e8c24180b73f0716fc13b459e
üst
b6bb2e93
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
20 deletions
+25
-20
timer.hxx
include/vcl/timer.hxx
+2
-2
svdata.hxx
vcl/inc/svdata.hxx
+1
-2
scheduler.cxx
vcl/source/app/scheduler.cxx
+21
-14
timer.cxx
vcl/source/app/timer.cxx
+1
-2
No files found.
include/vcl/timer.hxx
Dosyayı görüntüle @
01f406bc
...
@@ -40,10 +40,10 @@ public:
...
@@ -40,10 +40,10 @@ public:
/// Make it possible to associate a callback with this timer handler
/// Make it possible to associate a callback with this timer handler
/// of course, you can also sub-class and override 'Invoke'
/// of course, you can also sub-class and override 'Invoke'
void
SetTimeout
(
sal_uLong
nTimeoutMs
);
sal_uLong
GetTimeout
()
const
{
return
mnTimeout
;
}
void
SetTimeoutHdl
(
const
Link
&
rLink
)
{
maTimeoutHdl
=
rLink
;
}
void
SetTimeoutHdl
(
const
Link
&
rLink
)
{
maTimeoutHdl
=
rLink
;
}
const
Link
&
GetTimeoutHdl
()
const
{
return
maTimeoutHdl
;
}
const
Link
&
GetTimeoutHdl
()
const
{
return
maTimeoutHdl
;
}
void
SetTimeout
(
sal_uLong
nTimeoutMs
);
sal_uLong
GetTimeout
()
const
{
return
mnTimeout
;
}
virtual
void
Invoke
()
SAL_OVERRIDE
;
virtual
void
Invoke
()
SAL_OVERRIDE
;
void
Timeout
()
{
Invoke
();
}
void
Timeout
()
{
Invoke
();
}
Timer
&
operator
=
(
const
Timer
&
rTimer
);
Timer
&
operator
=
(
const
Timer
&
rTimer
);
...
...
vcl/inc/svdata.hxx
Dosyayı görüntüle @
01f406bc
...
@@ -317,8 +317,7 @@ struct ImplSVData
...
@@ -317,8 +317,7 @@ struct ImplSVData
SalSystem
*
mpSalSystem
;
// SalSystem interface
SalSystem
*
mpSalSystem
;
// SalSystem interface
ResMgr
*
mpResMgr
;
// SV-Resource-Manager
ResMgr
*
mpResMgr
;
// SV-Resource-Manager
sal_uLong
mnTimerPeriod
;
// current timer period
sal_uLong
mnTimerPeriod
;
// current timer period
sal_uLong
mnTimerUpdate
;
// TimerCallbackProcs on stack
sal_uLong
mnUpdateStack
;
// Scheduler on stack
bool
mbNotAllTimerCalled
;
// true: Timer must still be processed
ImplSVAppData
maAppData
;
// indepen data for class Application
ImplSVAppData
maAppData
;
// indepen data for class Application
ImplSVGDIData
maGDIData
;
// indepen data for Output classes
ImplSVGDIData
maGDIData
;
// indepen data for Output classes
ImplSVWinData
maWinData
;
// indepen data for Windows classes
ImplSVWinData
maWinData
;
// indepen data for Windows classes
...
...
vcl/source/app/scheduler.cxx
Dosyayı görüntüle @
01f406bc
...
@@ -23,11 +23,14 @@
...
@@ -23,11 +23,14 @@
#include <vcl/timer.hxx>
#include <vcl/timer.hxx>
#include <saltimer.hxx>
#include <saltimer.hxx>
#define MAX_TIMER_PERIOD ((sal_uLong)0xFFFFFFFF)
void
ImplSchedulerData
::
Invoke
()
void
ImplSchedulerData
::
Invoke
()
{
{
if
(
mbDelete
||
mbInScheduler
)
if
(
mbDelete
||
mbInScheduler
)
return
;
return
;
// prepare Scheduler Object for deletion after handling
mpScheduler
->
SetDeletionFlags
();
mpScheduler
->
SetDeletionFlags
();
// invoke it
// invoke it
...
@@ -41,20 +44,20 @@ ImplSchedulerData *ImplSchedulerData::GetMostImportantTask( bool bTimer )
...
@@ -41,20 +44,20 @@ ImplSchedulerData *ImplSchedulerData::GetMostImportantTask( bool bTimer )
ImplSVData
*
pSVData
=
ImplGetSVData
();
ImplSVData
*
pSVData
=
ImplGetSVData
();
ImplSchedulerData
*
pMostUrgent
=
NULL
;
ImplSchedulerData
*
pMostUrgent
=
NULL
;
for
(
ImplSchedulerData
*
p
=
pSVData
->
mpFirstSchedulerData
;
p
;
p
=
p
->
mpNext
)
for
(
ImplSchedulerData
*
p
SchedulerData
=
pSVData
->
mpFirstSchedulerData
;
pSchedulerData
;
pSchedulerData
=
pSchedulerData
->
mpNext
)
{
{
if
(
!
p
->
mpScheduler
||
p
->
mbDelete
||
p
->
mnUpdateStack
>=
pSVData
->
mnTimerUpdate
||
!
p
->
mpScheduler
->
ReadyForSchedule
(
bTimer
)
)
if
(
!
pSchedulerData
->
mpScheduler
||
pSchedulerData
->
mbDelete
||
pSchedulerData
->
mnUpdateStack
>=
pSVData
->
mnUpdateStack
||
!
pSchedulerData
->
mpScheduler
->
ReadyForSchedule
(
bTimer
)
)
continue
;
continue
;
if
(
!
pMostUrgent
)
if
(
!
pMostUrgent
)
pMostUrgent
=
p
;
pMostUrgent
=
p
SchedulerData
;
else
else
{
{
// Find the highest priority.
// Find the highest priority.
// If the priority of the current idle is higher (numerical value is lower) than
// If the priority of the current task is higher (numerical value is lower) than
// the priority of the most urgent, the priority of most urgent is increased and
// the priority of the most urgent, the current task gets the new most urgent.
// the current is the new most urgent. So starving is impossible.
if
(
pSchedulerData
->
mpScheduler
->
GetPriority
()
<
pMostUrgent
->
mpScheduler
->
GetPriority
()
)
if
(
p
->
mpScheduler
->
GetPriority
()
<
pMostUrgent
->
mpScheduler
->
GetPriority
()
)
pMostUrgent
=
pSchedulerData
;
pMostUrgent
=
p
;
}
}
}
}
...
@@ -101,6 +104,7 @@ void Scheduler::ImplDeInitScheduler()
...
@@ -101,6 +104,7 @@ void Scheduler::ImplDeInitScheduler()
void
Scheduler
::
CallbackTaskScheduling
(
bool
ignore
)
void
Scheduler
::
CallbackTaskScheduling
(
bool
ignore
)
{
{
// this function is for the saltimer callback
(
void
)
ignore
;
(
void
)
ignore
;
Scheduler
::
ProcessTaskScheduling
(
true
);
Scheduler
::
ProcessTaskScheduling
(
true
);
}
}
...
@@ -108,12 +112,13 @@ void Scheduler::CallbackTaskScheduling(bool ignore)
...
@@ -108,12 +112,13 @@ void Scheduler::CallbackTaskScheduling(bool ignore)
void
Scheduler
::
ProcessTaskScheduling
(
bool
bTimer
)
void
Scheduler
::
ProcessTaskScheduling
(
bool
bTimer
)
{
{
// process all pending Tasks
// process all pending Tasks
// if bTimer True, only handle timer
ImplSchedulerData
*
pSchedulerData
=
NULL
;
ImplSchedulerData
*
pSchedulerData
=
NULL
;
ImplSchedulerData
*
pPrevSchedulerData
=
NULL
;
ImplSchedulerData
*
pPrevSchedulerData
=
NULL
;
ImplSVData
*
pSVData
=
ImplGetSVData
();
ImplSVData
*
pSVData
=
ImplGetSVData
();
sal_uLong
nTime
=
tools
::
Time
::
GetSystemTicks
();
sal_uLong
nTime
=
tools
::
Time
::
GetSystemTicks
();
sal_uLong
nMinPeriod
=
((
sal_uLong
)
0xFFFFFFFF
)
;
sal_uLong
nMinPeriod
=
MAX_TIMER_PERIOD
;
pSVData
->
mn
TimerUpdate
++
;
pSVData
->
mn
UpdateStack
++
;
if
((
pSchedulerData
=
ImplSchedulerData
::
GetMostImportantTask
(
bTimer
)))
if
((
pSchedulerData
=
ImplSchedulerData
::
GetMostImportantTask
(
bTimer
)))
{
{
...
@@ -156,15 +161,17 @@ void Scheduler::ProcessTaskScheduling( bool bTimer )
...
@@ -156,15 +161,17 @@ void Scheduler::ProcessTaskScheduling( bool bTimer )
{
{
if
(
pSVData
->
mpSalTimer
)
if
(
pSVData
->
mpSalTimer
)
pSVData
->
mpSalTimer
->
Stop
();
pSVData
->
mpSalTimer
->
Stop
();
pSVData
->
mnTimerPeriod
=
((
sal_uLong
)
0xFFFFFFFF
)
;
pSVData
->
mnTimerPeriod
=
MAX_TIMER_PERIOD
;
}
}
else
else
Timer
::
ImplStartTimer
(
pSVData
,
nMinPeriod
);
Timer
::
ImplStartTimer
(
pSVData
,
nMinPeriod
);
pSVData
->
mn
TimerUpdate
--
;
pSVData
->
mn
UpdateStack
--
;
}
}
sal_uLong
Scheduler
::
UpdateMinPeriod
(
sal_uLong
nMinPeriod
,
sal_uLong
nTime
)
sal_uLong
Scheduler
::
UpdateMinPeriod
(
sal_uLong
nMinPeriod
,
sal_uLong
nTime
)
{
{
// this period is only usefull for timer
// so in this implementation it' only a pass through
(
void
)
nTime
;
(
void
)
nTime
;
return
nMinPeriod
;
return
nMinPeriod
;
}
}
...
@@ -182,7 +189,7 @@ void Scheduler::Start()
...
@@ -182,7 +189,7 @@ void Scheduler::Start()
ImplSVData
*
pSVData
=
ImplGetSVData
();
ImplSVData
*
pSVData
=
ImplGetSVData
();
if
(
!
mpSchedulerData
)
if
(
!
mpSchedulerData
)
{
{
// insert
Idle
// insert
Scheduler
mpSchedulerData
=
new
ImplSchedulerData
;
mpSchedulerData
=
new
ImplSchedulerData
;
mpSchedulerData
->
mpScheduler
=
this
;
mpSchedulerData
->
mpScheduler
=
this
;
mpSchedulerData
->
mbInScheduler
=
false
;
mpSchedulerData
->
mbInScheduler
=
false
;
...
@@ -203,7 +210,7 @@ void Scheduler::Start()
...
@@ -203,7 +210,7 @@ void Scheduler::Start()
}
}
mpSchedulerData
->
mbDelete
=
false
;
mpSchedulerData
->
mbDelete
=
false
;
mpSchedulerData
->
mnUpdateTime
=
tools
::
Time
::
GetSystemTicks
();
mpSchedulerData
->
mnUpdateTime
=
tools
::
Time
::
GetSystemTicks
();
mpSchedulerData
->
mnUpdateStack
=
pSVData
->
mn
TimerUpdate
;
mpSchedulerData
->
mnUpdateStack
=
pSVData
->
mn
UpdateStack
;
}
}
void
Scheduler
::
Stop
()
void
Scheduler
::
Stop
()
...
...
vcl/source/app/timer.cxx
Dosyayı görüntüle @
01f406bc
...
@@ -22,7 +22,6 @@
...
@@ -22,7 +22,6 @@
#include <saltimer.hxx>
#include <saltimer.hxx>
#include <svdata.hxx>
#include <svdata.hxx>
#include <salinst.hxx>
#include <salinst.hxx>
#include <vcl/scheduler.hxx>
#define MAX_TIMER_PERIOD ((sal_uLong)0xFFFFFFFF)
#define MAX_TIMER_PERIOD ((sal_uLong)0xFFFFFFFF)
...
@@ -122,7 +121,7 @@ void Timer::SetTimeout( sal_uLong nNewTimeout )
...
@@ -122,7 +121,7 @@ void Timer::SetTimeout( sal_uLong nNewTimeout )
if
(
mbActive
)
if
(
mbActive
)
{
{
ImplSVData
*
pSVData
=
ImplGetSVData
();
ImplSVData
*
pSVData
=
ImplGetSVData
();
if
(
!
pSVData
->
mn
TimerUpdate
&&
(
mnTimeout
<
pSVData
->
mnTimerPeriod
)
)
if
(
!
pSVData
->
mn
UpdateStack
&&
(
mnTimeout
<
pSVData
->
mnTimerPeriod
)
)
Timer
::
ImplStartTimer
(
pSVData
,
mnTimeout
);
Timer
::
ImplStartTimer
(
pSVData
,
mnTimeout
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment