src/Pure/System/swing_thread.scala
changeset 38847 57043221eb43
parent 38223 2a368e8e0a80
child 40848 8662b9b1f123
--- a/src/Pure/System/swing_thread.scala	Sun Aug 29 15:57:18 2010 +0200
+++ b/src/Pure/System/swing_thread.scala	Sun Aug 29 18:55:48 2010 +0200
@@ -23,7 +23,7 @@
 
   def now[A](body: => A): A =
   {
-    var result: Option[A] = None
+    @volatile var result: Option[A] = None
     if (SwingUtilities.isEventDispatchThread()) { result = Some(body) }
     else SwingUtilities.invokeAndWait(new Runnable { def run = { result = Some(body) } })
     result.get