equal
deleted
inserted
replaced
28 } |
28 } |
29 |
29 |
30 |
30 |
31 /* future result via thread */ |
31 /* future result via thread */ |
32 |
32 |
33 def future[A](name: String = "", daemon: Boolean = false)(body: => A): Future[A] = |
33 def future[A](name: String = "", daemon: Boolean = false)(body: => A): (Thread, Future[A]) = |
34 { |
34 { |
35 val result = Future.promise[A] |
35 val result = Future.promise[A] |
36 fork(name, daemon) { result.fulfill_result(Exn.capture(body)) } |
36 val thread = fork(name, daemon) { result.fulfill_result(Exn.capture(body)) } |
37 result |
37 (thread, result) |
38 } |
38 } |
39 |
39 |
40 |
40 |
41 /* thread as actor */ |
41 /* thread as actor */ |
42 |
42 |