-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: refactor Mount() for clarity (#96)
It looks like the Mount() method once used goroutines, and while this was removed, the complexity was not. This change does not change any behavior, but removes overly-complex structure. At the same time, VolumeDriver.volumes was changes to a map of value types (rather than pointers) to make it explict when updates were happening, as anyone with access to the pointer could make changes without the protection of a lock, but when a value, it's necessary to do an explicit Put() to update the map, so access to data is more controlled. There are still some potential data races in this code, for instance if two Mount() calls happen at the same time, then the mount counter might be incremented only once. The risk from this is low, but they should be fixed in the future.
- Loading branch information
Showing
1 changed file
with
56 additions
and
89 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