示例#1
0
        private static void PostAction(object state)
        {
            SynchronizationContextAwaitTaskContinuation synchronizationContextAwaitTaskContinuation = (SynchronizationContextAwaitTaskContinuation)state;
            TplEtwProvider log = TplEtwProvider.Log;

            if (log.TasksSetActivityIds && synchronizationContextAwaitTaskContinuation.m_continuationId != 0)
            {
                synchronizationContextAwaitTaskContinuation.m_syncContext.Post(SynchronizationContextAwaitTaskContinuation.s_postCallback, SynchronizationContextAwaitTaskContinuation.GetActionLogDelegate(synchronizationContextAwaitTaskContinuation.m_continuationId, synchronizationContextAwaitTaskContinuation.m_action));
                return;
            }
            synchronizationContextAwaitTaskContinuation.m_syncContext.Post(SynchronizationContextAwaitTaskContinuation.s_postCallback, synchronizationContextAwaitTaskContinuation.m_action);
        }
        private static void PostAction(object state)
        {
            SynchronizationContextAwaitTaskContinuation taskContinuation = (SynchronizationContextAwaitTaskContinuation)state;

            if (TplEtwProvider.Log.TasksSetActivityIds && taskContinuation.m_continuationId != 0)
            {
                taskContinuation.m_syncContext.Post(SynchronizationContextAwaitTaskContinuation.s_postCallback, (object)SynchronizationContextAwaitTaskContinuation.GetActionLogDelegate(taskContinuation.m_continuationId, taskContinuation.m_action));
            }
            else
            {
                taskContinuation.m_syncContext.Post(SynchronizationContextAwaitTaskContinuation.s_postCallback, (object)taskContinuation.m_action);
            }
        }
示例#3
0
        internal sealed override void Run(Task task, bool canInlineContinuationTask)
        {
            if (canInlineContinuationTask && this.m_syncContext == SynchronizationContext.CurrentNoFlow)
            {
                base.RunCallback(AwaitTaskContinuation.GetInvokeActionCallback(), this.m_action, ref Task.t_currentTask);
                return;
            }
            TplEtwProvider log = TplEtwProvider.Log;

            if (log.IsEnabled())
            {
                this.m_continuationId = Task.NewId();
                log.AwaitTaskContinuationScheduled((task.ExecutingTaskScheduler ?? TaskScheduler.Default).Id, task.Id, this.m_continuationId);
            }
            base.RunCallback(SynchronizationContextAwaitTaskContinuation.GetPostActionCallback(), this, ref Task.t_currentTask);
        }
 internal override sealed void Run(Task task, bool canInlineContinuationTask)
 {
     if (canInlineContinuationTask && this.m_syncContext == SynchronizationContext.CurrentNoFlow)
     {
         this.RunCallback(AwaitTaskContinuation.GetInvokeActionCallback(), (object)this.m_action, ref Task.t_currentTask);
     }
     else
     {
         TplEtwProvider tplEtwProvider = TplEtwProvider.Log;
         if (tplEtwProvider.IsEnabled())
         {
             this.m_continuationId = Task.NewId();
             tplEtwProvider.AwaitTaskContinuationScheduled((task.ExecutingTaskScheduler ?? TaskScheduler.Default).Id, task.Id, this.m_continuationId);
         }
         this.RunCallback(SynchronizationContextAwaitTaskContinuation.GetPostActionCallback(), (object)this, ref Task.t_currentTask);
     }
 }