diff options
author | Dmitry Petrashko <dark@d-d.me> | 2017-04-19 11:07:47 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-19 11:07:47 -0500 |
commit | d799a9162da02eb6033f5d7af5ea48849cd4232b (patch) | |
tree | e44f314e4eef44e2079b831543980c3596317fbc /library/src | |
parent | 02e38832668ed2a0504a77dd4f86270fa1a1d4bf (diff) | |
download | dotty-d799a9162da02eb6033f5d7af5ea48849cd4232b.tar.gz dotty-d799a9162da02eb6033f5d7af5ea48849cd4232b.tar.bz2 dotty-d799a9162da02eb6033f5d7af5ea48849cd4232b.zip |
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.
Diffstat (limited to 'library/src')
-rw-r--r-- | library/src/dotty/runtime/LazyVals.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/library/src/dotty/runtime/LazyVals.scala b/library/src/dotty/runtime/LazyVals.scala index 4dea0d34d..9a7e153b0 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(cur, ord) == 2) + monitor.wait() } } else retry = false |