-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ongoing] Rewrite ongoing events to use a map
The original implementation used a single Option in a Mutex to hold the current path undergoing ongoing writes. The issue brought up by Sujit Joshi in #191 was that this fails to perform correctly when more than one path is undergoing ongoing writes. The solution is to instead use a map to hold path -> instant pairs. Because the map has to be shared between threads, and besides needs to be held from two structs at once, a CHashMap is used. An ad-hoc construction with stdlib data structures and sync primitives could have been set up, but the CHashMap saves that boilerplate and offers elegant usage patterns that make the code clearer and more understandable. Additionally, another issue was identified in that the ongoing event state was not cleared when the feature is disabled. Finally, the terminology was changed from ongoing duration -> delay, and various identifiers internally were made more concise.
- Loading branch information
Showing
8 changed files
with
61 additions
and
65 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
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
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