-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix race condition in CommandMap#prefix
`PrefixProvider#[]` could return `nil` in multi-threaded scenarios due to a race condition involving `||=`, which is not an atomic operation in JRuby. The test that I added failed with JRuby 9.0.4.0 before the fix; now it passes.
- Loading branch information
1 parent
29f75ad
commit c2ce73e
Showing
2 changed files
with
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,8 +28,6 @@ def initialize | |
|
||
def [](command) | ||
@storage[command] ||= [] | ||
|
||
@storage[command] | ||
end | ||
end | ||
|
||
|
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