LibreOffice Module vcl (master) 1
|
#include <scheduler.hxx>
Static Public Member Functions | |
static void | ImplDeInitScheduler () |
static void | CallbackTaskScheduling () |
System timer callback function, which processes one LO task. More... | |
static void | ProcessEventsToIdle () |
Process all events until none is pending. More... | |
static void | Wakeup () |
Wakes up the scheduler. More... | |
static void | SetDeterministicMode (bool bDeterministic) |
Control the deterministic mode. More... | |
static bool | GetDeterministicMode () |
Return the current state of deterministic mode. More... | |
Static Public Attributes | |
static constexpr sal_uInt64 | ImmediateTimeoutMs = 0 |
static constexpr sal_uInt64 | InfiniteTimeoutMs = SAL_MAX_UINT64 |
Private Member Functions | |
Scheduler ()=delete | |
Static Private Member Functions | |
static void | UpdateSystemTimer (ImplSchedulerContext &rSchedCtx, sal_uInt64 nMinPeriod, bool bForce, sal_uInt64 nTime) |
static void | ImplStartTimer (sal_uInt64 nMS, bool bForce, sal_uInt64 nTime) |
Start a new timer if we need to for nMS duration. More... | |
static void | Lock () |
static void | Unlock () |
Friends | |
class | SchedulerGuard |
class | Task |
Definition at line 27 of file scheduler.hxx.
|
privatedelete |
|
static |
System timer callback function, which processes one LO task.
Will restart the system timer, so it will process further tasks at the right time.
Definition at line 329 of file scheduler.cxx.
References Application::AnyInput(), AppendSchedulerData(), DBG_TESTSOLARMUTEX, DropSchedulerData(), Task::GetDebugName(), tools::Time::GetSystemTicks(), HIGH_IDLE, ImmediateTimeoutMs, ImplGetSVData(), InfiniteTimeoutMs, Task::Invoke(), Task::IsActive(), KEYBOARD, Lock(), LOWEST, ImplSVData::maSchedCtx, ImplSchedulerContext::mbActive, ImplSchedulerData::mbInScheduler, ImplSchedulerData::mePriority, ImplSchedulerContext::mnTimerPeriod, ImplSchedulerContext::mnTimerStart, ImplSchedulerData::mnUpdateTime, MOUSE, ImplSchedulerContext::mpFirstSchedulerData, ImplSchedulerData::mpNext, Task::mpSchedulerData, ImplSchedulerContext::mpSchedulerStack, ImplSchedulerContext::mpSchedulerStackTop, ImplSchedulerData::mpTask, name, PAINT, PRIO_COUNT, SAL_INFO, SAL_WARN, Task::SetDeletionFlags(), TOOLS_WARN_EXCEPTION, Unlock(), Task::UpdateMinPeriod(), and UpdateSystemTimer().
Referenced by ImplStartTimer().
|
static |
Return the current state of deterministic mode.
Definition at line 269 of file scheduler.cxx.
References g_bDeterministicMode.
Referenced by Idle::Start().
|
static |
Definition at line 101 of file scheduler.cxx.
References DBG_TESTSOLARMUTEX, Task::GetDebugName(), ImplGetSVData(), InfiniteTimeoutMs, Lock(), ImplSVData::maSchedCtx, Task::mbActive, ImplSchedulerContext::mbActive, ImplSchedulerContext::mnTimerPeriod, ImplSchedulerContext::mpFirstSchedulerData, ImplSchedulerContext::mpLastSchedulerData, ImplSchedulerData::mpNext, ImplSchedulerContext::mpSalTimer, Task::mpSchedulerData, ImplSchedulerContext::mpSchedulerStack, ImplSchedulerData::mpTask, PRIO_COUNT, ProcessEventsToIdle(), SAL_INFO, SAL_WARN, SAL_WARN_IF, Task::SetStatic(), SalTimer::Stop(), and Unlock().
Referenced by DeInitVCL().
|
staticprivate |
Start a new timer if we need to for nMS duration.
if this is longer than the existing duration we're waiting for, do nothing - unless bForce - which means to reset the minimum period; used by the scheduled itself.
Definition at line 230 of file scheduler.cxx.
References CallbackTaskScheduling(), SalInstance::CreateSalTimer(), if(), ImplGetSVData(), InfiniteTimeoutMs, ImplSVData::maSchedCtx, ImplSchedulerContext::mbActive, ImplSchedulerContext::mnTimerPeriod, ImplSchedulerContext::mnTimerStart, ImplSVData::mpDefInst, ImplSchedulerContext::mpSalTimer, SAL_INFO, SAL_MAX_UINT64, SalTimer::SetCallback(), and SalTimer::Start().
Referenced by Task::StartTimer(), UpdateSystemTimer(), and Wakeup().
|
staticprivate |
Definition at line 209 of file scheduler.cxx.
References ImplGetSVData(), ImplSchedulerContext::maMutex, and ImplSVData::maSchedCtx.
Referenced by CallbackTaskScheduling(), ImplDeInitScheduler(), and SchedulerGuard::SchedulerGuard().
|
static |
Process all events until none is pending.
This can busy-lock, if some task or system event always generates new events when being processed. Most time it's called in unit tests to process all pending events. Internally it just calls Application::Reschedule( true ) until it fails.
Definition at line 379 of file svapp.cxx.
References Task::GetDebugName(), ImplGetSVData(), ImplYield(), Task::IsActive(), SalInstance::IsMainThread(), ImplSVData::maSchedCtx, ImplSchedulerData::mbInScheduler, ImplSVData::mpDefInst, ImplSchedulerContext::mpFirstSchedulerData, ImplSchedulerData::mpNext, ImplSchedulerData::mpTask, PRIO_COUNT, and SAL_WARN.
Referenced by UIObjectUnoObj::executeAction(), ImplDeInitScheduler(), and unit_lok_process_events_to_idle().
|
static |
Control the deterministic mode.
In this mode, two subsequent runs of LibreOffice fire about the same amount idles.
Definition at line 264 of file scheduler.cxx.
References g_bDeterministicMode.
|
staticprivate |
Definition at line 216 of file scheduler.cxx.
References ImplGetSVData(), ImplSchedulerContext::maMutex, and ImplSVData::maSchedCtx.
Referenced by CallbackTaskScheduling(), ImplDeInitScheduler(), and SchedulerGuard::~SchedulerGuard().
|
inlinestaticprivate |
Definition at line 274 of file scheduler.cxx.
References ImplStartTimer(), InfiniteTimeoutMs, ImplSchedulerContext::mnTimerPeriod, ImplSchedulerContext::mpSalTimer, SAL_INFO, and SalTimer::Stop().
Referenced by CallbackTaskScheduling().
|
static |
Wakes up the scheduler.
This doesn't handle any events! It just ensures the Scheduler is run as soon as possible by forcing the Scheduler timer to fire.
Can be used for complex UpdateMinPeriod function, where the task is actually active but not ready and we want to skip the Task::Start() queue append for faster reaction.
Definition at line 539 of file scheduler.cxx.
References tools::Time::GetSystemTicks(), and ImplStartTimer().
|
friend |
Definition at line 29 of file scheduler.hxx.
|
friend |
Definition at line 30 of file scheduler.hxx.
|
staticconstexpr |
Definition at line 43 of file scheduler.hxx.
Referenced by CallbackTaskScheduling(), Idle::Start(), Idle::UpdateMinPeriod(), and Timer::UpdateMinPeriod().
|
staticconstexpr |
Definition at line 44 of file scheduler.hxx.
Referenced by CallbackTaskScheduling(), ImplDeInitScheduler(), ImplStartTimer(), Idle::Start(), and UpdateSystemTimer().