Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 9fb9458

Browse files
authored
Fix a potential race in iterating counters (#28112)
1 parent 96193fb commit 9fb9458

File tree

1 file changed

+1
-1
lines changed
  • src/System.Private.CoreLib/shared/System/Diagnostics/Tracing

1 file changed

+1
-1
lines changed

src/System.Private.CoreLib/shared/System/Diagnostics/Tracing/CounterGroup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ private void OnTimer()
224224
// above, since WritePayload callback can contain user code that can invoke EventSource constructor
225225
// and lead to a deadlock. (See https://github.com/dotnet/runtime/issues/40190 for details)
226226

227-
foreach (var counter in _counters)
227+
foreach (var counter in counters)
228228
{
229229
// NOTE: It is still possible for a race condition to occur here. An example is if the session
230230
// that subscribed to these batch of counters was disabled and it was immediately enabled in

0 commit comments

Comments
 (0)