-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
materialize: don't use locks in the extended logger
The use of a mutex in both the extended logger event handler and the async logger functions was simple, but there was a potential deadlock if the event handler needed to stop the logger and wait for it to stop while holding the lock, and the logger timer ticked over at nearly the same instant making the logger need to get the lock also to finish its last log before exiting. This updates the extended logger to not use locks at all, since it wasn't far from being able to do that in the first place. The "count" values that are read concurrently by the async loggers have been changed to use atomics, and for good measure the "round" counter is provided as an explicit argument to them, even though it doesn't strictly need to be, it's just easier to understand this way.
- Loading branch information
1 parent
44de46e
commit eb1bac1
Showing
1 changed file
with
54 additions
and
73 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