Пример #1
0
 // Token: 0x06004052 RID: 16466 RVA: 0x000EFB60 File Offset: 0x000EDD60
 internal StandardTaskContinuation(Task task, TaskContinuationOptions options, TaskScheduler scheduler)
 {
     this.m_task          = task;
     this.m_options       = options;
     this.m_taskScheduler = scheduler;
     if (AsyncCausalityTracer.LoggingOn)
     {
         AsyncCausalityTracer.TraceOperationCreation(CausalityTraceLevel.Required, this.m_task.Id, "Task.ContinueWith: " + ((Delegate)task.m_action).Method.Name, 0UL);
     }
     if (Task.s_asyncDebuggingEnabled)
     {
         Task.AddToActiveTasks(this.m_task);
     }
 }
Пример #2
0
        /// <summary>Initializes a new continuation.</summary>
        /// <param name="task">The task to be activated.</param>
        /// <param name="options">The continuation options.</param>
        /// <param name="scheduler">The scheduler to use for the continuation.</param>
        internal StandardTaskContinuation(Task task, TaskContinuationOptions options, TaskScheduler scheduler)
        {
            Debug.Assert(task != null, "TaskContinuation ctor: task is null");
            Debug.Assert(scheduler != null, "TaskContinuation ctor: scheduler is null");
            m_task          = task;
            m_options       = options;
            m_taskScheduler = scheduler;
            if (AsyncCausalityTracer.LoggingOn)
            {
                AsyncCausalityTracer.TraceOperationCreation(m_task, "Task.ContinueWith: " + task.m_action.Method.Name);
            }

            if (Task.s_asyncDebuggingEnabled)
            {
                Task.AddToActiveTasks(m_task);
            }
        }
Пример #3
0
        /// <summary>Initializes a new continuation.</summary>
        /// <param name="task">The task to be activated.</param>
        /// <param name="options">The continuation options.</param>
        /// <param name="scheduler">The scheduler to use for the continuation.</param>
        internal StandardTaskContinuation(Task task, TaskContinuationOptions options, TaskScheduler scheduler)
        {
            Contract.Requires(task != null, "TaskContinuation ctor: task is null");
            Contract.Requires(scheduler != null, "TaskContinuation ctor: scheduler is null");
            m_task          = task;
            m_options       = options;
            m_taskScheduler = scheduler;
            if (AsyncCausalityTracer.LoggingOn)
            {
                AsyncCausalityTracer.TraceOperationCreation(CausalityTraceLevel.Required, m_task.Id, "Task.ContinueWith: " + ((Delegate)task.m_action).Method.Name, 0);
            }

            if (Task.s_asyncDebuggingEnabled)
            {
                Task.AddToActiveTasks(m_task);
            }
        }
Пример #4
0
        /// <summary>Initializes a new continuation.</summary>
        /// <param name="task">The task to be activated.</param>
        /// <param name="options">The continuation options.</param>
        /// <param name="scheduler">The scheduler to use for the continuation.</param>
        internal ContinueWithTaskContinuation(Task task, TaskContinuationOptions options, TaskScheduler scheduler)
        {
            Debug.Assert(task != null, "TaskContinuation ctor: task is null");
            Debug.Assert(scheduler != null, "TaskContinuation ctor: scheduler is null");
            m_task          = task;
            m_options       = options;
            m_taskScheduler = scheduler;
            if (TplEventSource.Log.IsEnabled())
            {
                TplEventSource.Log.TraceOperationBegin(m_task.Id, "Task.ContinueWith: " + task.m_action !.Method.Name, 0);
            }

            if (Task.s_asyncDebuggingEnabled)
            {
                Task.AddToActiveTasks(m_task);
            }
        }
 // Token: 0x0600403F RID: 16447 RVA: 0x000EF5B8 File Offset: 0x000ED7B8
 public UnwrapPromise(Task outerTask, bool lookForOce) : base(null, outerTask.CreationOptions & TaskCreationOptions.AttachedToParent)
 {
     this._lookForOce = lookForOce;
     this._state      = 0;
     if (AsyncCausalityTracer.LoggingOn)
     {
         AsyncCausalityTracer.TraceOperationCreation(CausalityTraceLevel.Required, base.Id, "Task.Unwrap", 0UL);
     }
     if (Task.s_asyncDebuggingEnabled)
     {
         Task.AddToActiveTasks(this);
     }
     if (outerTask.IsCompleted)
     {
         this.ProcessCompletedOuterTask(outerTask);
         return;
     }
     outerTask.AddCompletionAction(this);
 }