equal
deleted
inserted
replaced
24 thread.setDaemon(daemon) |
24 thread.setDaemon(daemon) |
25 thread.start |
25 thread.start |
26 thread |
26 thread |
27 } |
27 } |
28 |
28 |
29 /* future result */ |
29 def fork(body: => Unit): Thread = fork()(body) |
|
30 |
|
31 |
|
32 /* future result via thread */ |
30 |
33 |
31 def future[A](name: String = "", daemon: Boolean = false)(body: => A): Future[A] = |
34 def future[A](name: String = "", daemon: Boolean = false)(body: => A): Future[A] = |
32 { |
35 { |
33 val result = Future.promise[A] |
36 val result = Future.promise[A] |
34 fork(name, daemon) { result.fulfill_result(Exn.capture(body)) } |
37 fork(name, daemon) { result.fulfill_result(Exn.capture(body)) } |