Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make cache and values fully thread-safe
Not locking the default initialization can lead to race-conditions. I don't think we can switch to Concurrent::Map, and it's compute_if_absent method, because insertion order won't be maintained. So synchronize the long way. ref: ruby-concurrency/concurrent-ruby#970 Co-authored-by: Maciej Mensfeld <[email protected]> resolves #8951
- Loading branch information