1
0
forked from Mirror/wren

Fix deadlock bug in map insertion.

This commit is contained in:
Bob Nystrom
2015-08-06 06:55:30 -07:00
parent 71ab3ca887
commit 0631f3b109
2 changed files with 14 additions and 8 deletions

11
test/core/map/churn.wren Normal file
View File

@ -0,0 +1,11 @@
// This is a regression test for a bug where inserting in a map would not
// correctly reuse tombstone entries, eventually deadlocking on insert.
var map = {}
for (i in 0...100) {
map[i] = i
if (i >= 10) map.remove(i - 10)
}
IO.print(map.count) // expect: 10