diff --git a/base/dict.jl b/base/dict.jl index 1ad84df0aa89e..22ca27af4f2fa 100644 --- a/base/dict.jl +++ b/base/dict.jl @@ -223,22 +223,19 @@ end keys[index] = k vals[index] = v count += 1 - - if h.age != age0 - # if `h` is changed by a finalizer, retry - return rehash!(h, newsz) - end end end + @assert h.age == age0 "Muliple concurent writes to Dict detected!" + + h.age += 1 h.slots = slots h.keys = keys h.vals = vals h.count = count h.ndel = 0 h.maxprobe = maxprobe - @assert h.age == age0 - + return h end