| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library test; |
| 6 |
| 5 import 'dart:async'; | 7 import 'dart:async'; |
| 6 import 'dart:isolate'; | 8 import 'dart:isolate'; |
| 7 | 9 |
| 8 var firstFunction; | 10 var firstFunction; |
| 9 var finishFunction; | 11 var finishFunction; |
| 10 | 12 |
| 11 void runFunctions() { | 13 void runFunctions() { |
| 12 try { | 14 try { |
| 13 firstFunction(); | 15 firstFunction(); |
| 14 } catch (e) { | 16 } catch (e) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 32 } | 34 } |
| 33 | 35 |
| 34 main() { | 36 main() { |
| 35 var port = new ReceivePort(); | 37 var port = new ReceivePort(); |
| 36 var timer; | 38 var timer; |
| 37 SendPort otherIsolate = spawnFunction(runTest, globalErrorHandler); | 39 SendPort otherIsolate = spawnFunction(runTest, globalErrorHandler); |
| 38 otherIsolate.send(port.toSendPort()); | 40 otherIsolate.send(port.toSendPort()); |
| 39 port.receive((msg, replyPort) { port.close(); timer.cancel(); }); | 41 port.receive((msg, replyPort) { port.close(); timer.cancel(); }); |
| 40 timer = new Timer(const Duration(seconds: 2), () { throw "failed"; }); | 42 timer = new Timer(const Duration(seconds: 2), () { throw "failed"; }); |
| 41 } | 43 } |
| OLD | NEW |