Skip to content

Commit d799a91

Browse files
authored
Fix the infinite cycle in Lazy Vlas
Reported by Andrzej Plutecki in https://groups.google.com/forum/#!topic/dotty-internals/3LMNItLQw-A I haven't seen this happen in practice in hours and hours of benchmarking, but this is indeed a formal bug.
1 parent 02e3883 commit d799a91

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library/src/dotty/runtime/LazyVals.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ object LazyVals {
5555
else if (state == 2) {
5656
val monitor = getMonitor(t, ord)
5757
monitor.synchronized {
58-
monitor.wait()
58+
if (STATE(cur, ord) == 2)
59+
monitor.wait()
5960
}
6061
}
6162
else retry = false

0 commit comments

Comments
 (0)