Skip to content

Commit 5709485

Browse files
DarkDimiusnicolasstucki
authored andcommitted
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 0eb0423 commit 5709485

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library/src/dotty/runtime/LazyVals.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ object LazyVals {
6767
else if (state == 2) {
6868
val monitor = getMonitor(t, ord)
6969
monitor.synchronized {
70-
monitor.wait()
70+
if (STATE(cur, ord) == 2)
71+
monitor.wait()
7172
}
7273
}
7374
else retry = false

0 commit comments

Comments
 (0)