/// <summary> /// This is needed for platform backends that don't have internal priority system (e. g. win32) /// To ensure that there are no jobs with higher priority /// </summary> /// <param name="currentPriority"></param> internal void EnsurePriority(DispatcherPriority currentPriority) { if (currentPriority == DispatcherPriority.MaxValue) { return; } currentPriority += 1; _jobRunner.RunJobs(currentPriority); }
public void RunLoop(CancellationToken cancellationToken) { while (!cancellationToken.IsCancellationRequested) { _evnt.WaitOne(); if (cancellationToken.IsCancellationRequested) { return; } Signaled?.Invoke(); _timerJobRunner.RunJobs(); } }
/// <summary> /// Use this method to ensure that more prioritized tasks are executed /// </summary> /// <param name="minimumPriority"></param> public void RunJobs(DispatcherPriority minimumPriority) => _jobRunner.RunJobs(minimumPriority);
/// <summary> /// Runs continuations pushed on the loop. /// </summary> public void RunJobs() { _jobRunner?.RunJobs(null); }