LibreOffice Module vcl (master) 1
Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Friends | List of all members
Scheduler Class Referencefinal

#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 ()


class SchedulerGuard
class Task

Detailed Description

Definition at line 27 of file scheduler.hxx.

Constructor & Destructor Documentation

◆ Scheduler()

Scheduler::Scheduler ( )

Member Function Documentation

◆ CallbackTaskScheduling()

void Scheduler::CallbackTaskScheduling ( )

◆ GetDeterministicMode()

bool Scheduler::GetDeterministicMode ( )

Return the current state of deterministic mode.

Definition at line 269 of file scheduler.cxx.

References g_bDeterministicMode.

Referenced by Idle::Start().

◆ ImplDeInitScheduler()

void Scheduler::ImplDeInitScheduler ( )

◆ ImplStartTimer()

void Scheduler::ImplStartTimer ( sal_uInt64  nMS,
bool  bForce,
sal_uInt64  nTime 

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().

◆ Lock()

void Scheduler::Lock ( )

◆ ProcessEventsToIdle()

void Scheduler::ProcessEventsToIdle ( )

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.

See also

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().

◆ SetDeterministicMode()

void Scheduler::SetDeterministicMode ( bool  bDeterministic)

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.

◆ Unlock()

void Scheduler::Unlock ( )

◆ UpdateSystemTimer()

void Scheduler::UpdateSystemTimer ( ImplSchedulerContext rSchedCtx,
sal_uInt64  nMinPeriod,
bool  bForce,
sal_uInt64  nTime 

◆ Wakeup()

void Scheduler::Wakeup ( )

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().

Friends And Related Function Documentation

◆ SchedulerGuard

friend class SchedulerGuard

Definition at line 29 of file scheduler.hxx.

◆ Task

friend class Task

Definition at line 30 of file scheduler.hxx.

Member Data Documentation

◆ ImmediateTimeoutMs

constexpr sal_uInt64 Scheduler::ImmediateTimeoutMs = 0

◆ InfiniteTimeoutMs

constexpr sal_uInt64 Scheduler::InfiniteTimeoutMs = SAL_MAX_UINT64

The documentation for this class was generated from the following files: