Swing_Thread.now: volatile result to make double-sure;
authorwenzelm
Sun, 29 Aug 2010 18:55:48 +0200
changeset 38847 57043221eb43
parent 38846 e54c33dbe77c
child 38848 9483bb678d96
Swing_Thread.now: volatile result to make double-sure;
src/Pure/System/swing_thread.scala
--- 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