diff --git a/library/src/dotty/runtime/LazyVals.scala b/library/src/dotty/runtime/LazyVals.scala index 4dea0d34dbe9..2094cff8e9a4 100644 --- a/library/src/dotty/runtime/LazyVals.scala +++ b/library/src/dotty/runtime/LazyVals.scala @@ -55,7 +55,8 @@ object LazyVals { else if (state == 2) { val monitor = getMonitor(t, ord) monitor.synchronized { - monitor.wait() + if (STATE(get(t, offset), ord) == 2) // make sure notification did not happen yet. + monitor.wait() } } else retry = false