| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 | 5 |
| 6 /** | 6 /** |
| 7 * The `dart:isolate` library defines APIs to spawn and communicate with | 7 * The `dart:isolate` library defines APIs to spawn and communicate with |
| 8 * isolates. | 8 * isolates. |
| 9 * | 9 * |
| 10 * All code in dart runs in the context of an isolate. Each isolate has its own | 10 * All code in dart runs in the context of an isolate. Each isolate has its own |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 */ | 36 */ |
| 37 #library("dart:isolate"); | 37 #library("dart:isolate"); |
| 38 | 38 |
| 39 #import("dart:uri"); | 39 #import("dart:uri"); |
| 40 #source("isolate_api.dart"); | 40 #source("isolate_api.dart"); |
| 41 #source("timer.dart"); | 41 #source("timer.dart"); |
| 42 #source("timer_hook.dart"); | 42 #source("timer_hook.dart"); |
| 43 #source("serialization.dart"); | 43 #source("serialization.dart"); |
| 44 #source("dart2js/compiler_hooks.dart"); | 44 #source("dart2js/compiler_hooks.dart"); |
| 45 #source("dart2js/isolateimpl.dart"); | 45 #source("dart2js/isolateimpl.dart"); |
| 46 #source("dart2js/messages.dart"); |
| 46 #source("dart2js/ports.dart"); | 47 #source("dart2js/ports.dart"); |
| 47 #source("dart2js/messages.dart"); | 48 #source("dart2js/timer_provider.dart"); |
| 48 | 49 |
| 49 /** | 50 /** |
| 50 * Called by the compiler to support switching | 51 * Called by the compiler to support switching |
| 51 * between isolates when we get a callback from the DOM. | 52 * between isolates when we get a callback from the DOM. |
| 52 */ | 53 */ |
| 53 void _callInIsolate(_IsolateContext isolate, Function function) { | 54 void _callInIsolate(_IsolateContext isolate, Function function) { |
| 54 isolate.eval(function); | 55 isolate.eval(function); |
| 55 _globalState.topEventLoop.run(); | 56 _globalState.topEventLoop.run(); |
| 56 } | 57 } |
| 57 | 58 |
| 58 /** | 59 /** |
| 59 * Called by the compiler to fetch the current isolate context. | 60 * Called by the compiler to fetch the current isolate context. |
| 60 */ | 61 */ |
| 61 void _currentIsolate() => _globalState.currentContext; | 62 void _currentIsolate() => _globalState.currentContext; |
| OLD | NEW |