Ejemplo n.º 1
0
 public TransitionMonitor(
     TransitionContext context,
     ITaskContinuationTracker taskContinuationTracker,
     ITaskContinuationClassifier taskContinuationClassifier,
     IIntrinsicFlowController intrinsicFlowController,
     IAsyncStateMachineMetadataProvider asyncStateMachineMetadataProvider)
 {
     Context = context;
     _taskContinuationTracker           = taskContinuationTracker;
     _taskContinuationClassifier        = taskContinuationClassifier;
     _intrinsicFlowController           = intrinsicFlowController;
     _asyncStateMachineMetadataProvider = asyncStateMachineMetadataProvider;
     _onRoutineContinuationSetCallback  = OnRoutineContinuationSet;
 }
Ejemplo n.º 2
0
        public bool StartTracking(Task task, OnTaskContinuationSetCallback callback, object userData)
        {
            var trackedTask = new TrackedTask
            {
                TaskReference = new WeakReference <Task>(task, trackResurrection: false),
                Callback      = callback,
                UserData      = userData
            };

            lock (_trackedTasks)
            {
                _trackedTasks.Add(trackedTask);
            }

            return(true);
        }