-
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.
Fix EventSource shutdown deadlock (#56453)
Fixes #48342 A deadlock was occuring because we held the EventListenersLock while calling into EventUnregister which will take ETW's own native lock. In the case of ETW sending an enable/disable notification these locks are taken in reverse order which triggers a deadlock. The fix is to ensure that we always order the locks so that any code path taking both locks always takes the ETW lock first. In this case it meant accumulating the list of event sources to dispose under the lock but then exiting the lock prior to calling Dispose() which will eventually call EventUnregister.
- Loading branch information
Showing
2 changed files
with
18 additions
and
2 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