Skip to content

Commit

Permalink
Make exception count performance counter thread-safe (#86018)
Browse files Browse the repository at this point in the history
Fixes #85997
  • Loading branch information
jkotas committed May 10, 2023
1 parent bc11753 commit d7c2594
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/coreclr/vm/exceptionhandling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ void FreeTrackerMemory(ExceptionTracker* pTracker, TrackerMemoryType mem)
static inline void UpdatePerformanceMetrics(CrawlFrame *pcfThisFrame, BOOL bIsRethrownException, BOOL bIsNewException)
{
WRAPPER_NO_CONTRACT;
g_exceptionCount++;
InterlockedIncrement((LONG*)&g_exceptionCount);

// Fire an exception thrown ETW event when an exception occurs
ETW::ExceptionLog::ExceptionThrown(pcfThisFrame, bIsRethrownException, bIsNewException);
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/i386/excepx86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,7 @@ CPFH_RealFirstPassHandler( // ExceptionContinueSearch, etc.

EEToProfilerExceptionInterfaceWrapper::ExceptionThrown(pThread);

g_exceptionCount++;
InterlockedIncrement((LONG*)&g_exceptionCount);

} // End of case-1-or-3

Expand Down

0 comments on commit d7c2594

Please sign in to comment.