Exemple #1
0
 private static void HandleException(ITask currentTask, Exception e)
 {
     Dispatcher.LogError(Resource1.HandleExceptionLog, e);
     Dispatcher.FilterExceptionThroughCausalities(currentTask, e);
     Dispatcher.SetCurrentThreadCausalities(null);
     if (currentTask != null && currentTask.ArbiterCleanupHandler != null)
     {
         try
         {
             currentTask.ArbiterCleanupHandler();
         }
         catch (Exception exception)
         {
             Dispatcher.LogError(Resource1.ExceptionDuringArbiterCleanup, exception);
         }
     }
 }
Exemple #2
0
        private void TaskExecutionPolicyEngaged(ITask task, bool throttlingEnabled)
        {
            if (!throttlingEnabled)
            {
                Interlocked.Decrement(ref _dispatcher._pendingTaskCount);
            }
            if (task != null && task.ArbiterCleanupHandler != null)
            {
                task.ArbiterCleanupHandler();
            }
            Port <ITask> policyNotificationPort = _policyNotificationPort;

            if (policyNotificationPort != null)
            {
                policyNotificationPort.Post(throttlingEnabled ? null : task);
            }
        }