Changeset 1132


Ignore:
Timestamp:
6/16/2009 5:28:47 AM (5 years ago)
Author:
lowjoel
Message:

Fixed the InvalidOperationException? thrown when we gather thread information for entropy and the thread has exited (in the middle of our foreach)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser6/Eraser.Manager/EntropySource.cs

    r1009 r1132  
    334334            foreach (ProcessThread thread in currProcess.Threads) 
    335335            { 
    336                 result.AddRange(StructToBuffer(thread.TotalProcessorTime)); 
    337                 result.AddRange(StructToBuffer(thread.UserProcessorTime)); 
    338                 result.AddRange(StructToBuffer(thread.PrivilegedProcessorTime)); 
     336                try 
     337                { 
     338                    result.AddRange(StructToBuffer(thread.TotalProcessorTime)); 
     339                    result.AddRange(StructToBuffer(thread.UserProcessorTime)); 
     340                    result.AddRange(StructToBuffer(thread.PrivilegedProcessorTime)); 
     341                } 
     342                catch (InvalidOperationException) 
     343                { 
     344                    //Caught when the thread has exited in the middle of the foreach. 
     345                } 
    339346            } 
    340347 
Note: See TracChangeset for help on using the changeset viewer.