diff options
Diffstat (limited to 'test/files/run/lazy-concurrent.scala')
-rw-r--r-- | test/files/run/lazy-concurrent.scala | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/files/run/lazy-concurrent.scala b/test/files/run/lazy-concurrent.scala new file mode 100644 index 0000000000..4699ed6a15 --- /dev/null +++ b/test/files/run/lazy-concurrent.scala @@ -0,0 +1,17 @@ +object Test { + def main(args: Array[String]) { + class Singleton { + val field = () + println("Initializing singleton.") + } + lazy val Singleton = new Singleton + + var i = 0 + while (i < 4) { + new Thread(new Runnable { + def run = Singleton.field + }).start + i += 1 + } + } +} |