Changeset 1664


Ignore:
Timestamp:
1/25/2010 3:32:36 AM (4 years ago)
Author:
lowjoel
Message:

Start a new logging session the moment we fetch the task of the task list. This allows errors to be logged even when the Task Started event is broadcast (as sometimes exceptions may be thrown). This fixes crashes where exceptions are thrown during the Task Started event processing goes on.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/6.0/Eraser.Manager/DirectExecutor.cs

    r1643 r1664  
    235235                    currentTask = task; 
    236236 
     237                    //Prevent the system from sleeping. 
     238                    KernelApi.SetThreadExecutionState(ThreadExecutionState.Continuous | 
     239                        ThreadExecutionState.SystemRequired); 
     240 
     241                    //Start a new log session to separate this session's events 
     242                    //from previous ones. 
     243                    task.Log.Entries.NewSession(); 
     244 
    237245                    try 
    238246                    { 
    239                         //Prevent the system from sleeping. 
    240                         KernelApi.SetThreadExecutionState(ThreadExecutionState.Continuous | 
    241                             ThreadExecutionState.SystemRequired); 
    242  
    243247                        //Broadcast the task started event. 
    244248                        task.Canceled = false; 
    245249                        task.OnTaskStarted(new TaskEventArgs(task)); 
    246250                        OnTaskProcessing(new TaskEventArgs(task)); 
    247  
    248                         //Start a new log session to separate this session's events 
    249                         //from previous ones. 
    250                         task.Log.Entries.NewSession(); 
    251251 
    252252                        //Run the task 
Note: See TracChangeset for help on using the changeset viewer.