This repository was archived by the owner on Mar 15, 2022. It is now read-only.
Commit 11a0047
committed
Fix default block race condition.
By the time `elsif !key?(key)` is called another thread might have
created a `key` mapping, then `!key?(key)` check would then fail
resulting in `[]` returning `nil` an incorrect `value`.
This is most likely to be triggered by a code like this:
ThreadSafe::Cache.new {|cache, key| cache[key] = some_value}
Related: rails/rails#13961.1 parent 720e366 commit 11a0047
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
41 | 45 | | |
42 | 46 | | |
43 | 47 | | |
| |||
0 commit comments