-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make counters use dedicated thread instead of timer (dotnet/coreclr#2…
…5864) * Make a dedicated polling thread for EventCounters * Cleanup * remove debug prints * nit * Fix comment * addressing issues from code review * Fix an assertion from getting fired when we have multiple listeners * Fix a test issue * code review feedback * Fix a potential deadlock * Fix another deadlock * Allow s_sleepDurationInMilliseconds to be reset to a larger value * More issues fix * Let thread wake up from sleep if needed * Some suggestions for the counters fix. The resulting behavior should be the same as what is there now (assuming I didn't mess anything up), these are all just code simplifications that hopefully make it easier to review and maintain going forward. In total I think this reduces the change size in CounterGroup.cs by ~30%. - With the addition of the AutoResetEvent the ManualResetEvent is no longer needed, removed it. - Removed the various if foo != null checks for the shared state, it is all initialized once when then thread is created and then assumed to be non-null elsewhere. - Removed a 2nd lock acquisition inside OnTimer - Replaced an if with Math.Min in PollForValues * fix test Commit migrated from dotnet/coreclr@b3de897
- Loading branch information
Showing
3 changed files
with
93 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters