Exemplo n.º 1
0
        private TryAddTaskResult executeTaskOnInnerScheduler(Task task)
        {
            var taskExecutedInline = m_originalScheduler.TryExecuteTaskInline(task, false);

            if (taskExecutedInline)
            {
                return(TryAddTaskResult.ExecutedInline);
            }

            m_originalScheduler.QueueTask(task);
            return(TryAddTaskResult.Added);
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
 protected override void QueueTask(Task task)
 {
     task.SetProxyScheduler(this);
     m_realScheduler.QueueTask(task);
 }