private TryAddTaskResult executeTaskOnInnerScheduler(Task task) { var taskExecutedInline = m_originalScheduler.TryExecuteTaskInline(task, false); if (taskExecutedInline) { return(TryAddTaskResult.ExecutedInline); } m_originalScheduler.QueueTask(task); return(TryAddTaskResult.Added); }
private void queueTasks(QueueTasksParams currentParams, List <Task> currentTasks) { while (canQueueTask(currentParams, currentTasks) && m_tasks.TryDequeue(out var task)) { currentTasks.Add(task); currentParams.BeforeTaskQueuedAction?.Invoke(task); if (currentParams.TaskContinuation != null) { task.ContinueWith(currentParams.TaskContinuation); } m_innerScheduler.QueueTask(task); currentParams.AfterTaskQueuedAction?.Invoke(task); } }
protected override void QueueTask(Task task) { task.SetProxyScheduler(this); m_realScheduler.QueueTask(task); }