--- a/src/Pure/System/swing_thread.scala Thu May 24 17:25:53 2012 +0200
+++ b/src/Pure/System/swing_thread.scala Thu May 24 17:42:47 2012 +0200
@@ -24,10 +24,11 @@
def now[A](body: => A): A =
{
- @volatile var result: Option[A] = None
- if (SwingUtilities.isEventDispatchThread()) { result = Some(body) }
- else SwingUtilities.invokeAndWait(new Runnable { def run = { result = Some(body) } })
- result.get
+ @volatile var result: Option[Exn.Result[A]] = None
+ if (SwingUtilities.isEventDispatchThread()) { result = Some(Exn.capture(body)) }
+ else
+ SwingUtilities.invokeAndWait(new Runnable { def run = { result = Some(Exn.capture(body)) } })
+ Exn.release(result.get)
}
def future[A](body: => A): Future[A] =