Avoid race condition in DiagnosticCounter (dotnet/coreclr#26260)
commit4dd0a137a4d39531b0a5aee6316f31c8335a4173
authorStephen Toub <stoub@microsoft.com>
Tue, 20 Aug 2019 19:21:27 +0000 (20 15:21 -0400)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Thu, 22 Aug 2019 14:59:43 +0000 (22 16:59 +0200)
tree51d5521763287e169108493cf967e123473be076
parent068660732fbf10cae688182ef67f72cf80ebb632
Avoid race condition in DiagnosticCounter (dotnet/coreclr#26260)

* Avoid race condition in DiagnosticCounter

If while a DiagnosticCounter instance is being created the timer fires to process counters, the timer may end up evaluating a DiagnosticCounter whose constructor or derived types' constructor hasn't finished configuring the instance's state yet.

* Remove unnecessary #if

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/DiagnosticCounter.cs
netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/EventCounter.cs
netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/IncrementingEventCounter.cs
netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/IncrementingPollingCounter.cs
netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/PollingCounter.cs