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 * Concurrent programming using _isolates_: | 6 * Concurrent programming using _isolates_: |
7 * independent workers that are similar to threads | 7 * independent workers that are similar to threads |
8 * but don't share memory, | 8 * but don't share memory, |
9 * communicating only via messages. | 9 * communicating only via messages. |
10 */ | 10 */ |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 * | 113 * |
114 * If all the available capabilities are included, | 114 * If all the available capabilities are included, |
115 * there is no reason to create a new object, | 115 * there is no reason to create a new object, |
116 * since the behavior is defined entirely | 116 * since the behavior is defined entirely |
117 * by the control port and capabilities. | 117 * by the control port and capabilities. |
118 */ | 118 */ |
119 Isolate(this.controlPort, {this.pauseCapability, | 119 Isolate(this.controlPort, {this.pauseCapability, |
120 this.terminateCapability}); | 120 this.terminateCapability}); |
121 | 121 |
122 /** | 122 /** |
| 123 * Return the current [Isolate]. |
| 124 * |
| 125 * The isolate gives access to the capabilities needed to inspect, |
| 126 * pause or kill the isolate, and allows granting these capabilities |
| 127 * to others. |
| 128 */ |
| 129 external static Isolate get current; |
| 130 |
| 131 /** |
123 * Creates and spawns an isolate that shares the same code as the current | 132 * Creates and spawns an isolate that shares the same code as the current |
124 * isolate. | 133 * isolate. |
125 * | 134 * |
126 * The argument [entryPoint] specifies the entry point of the spawned | 135 * The argument [entryPoint] specifies the entry point of the spawned |
127 * isolate. It must be a top-level function or a static method that | 136 * isolate. It must be a top-level function or a static method that |
128 * takes one argument - that is, one-parameter functions that can be | 137 * takes one argument - that is, one-parameter functions that can be |
129 * compile-time constant function values. | 138 * compile-time constant function values. |
130 * It is not allowed to pass the value of function expressions or an instance | 139 * It is not allowed to pass the value of function expressions or an instance |
131 * method extracted from an object. | 140 * method extracted from an object. |
132 * | 141 * |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 : _description = description, | 609 : _description = description, |
601 stackTrace = new _RemoteStackTrace(stackDescription); | 610 stackTrace = new _RemoteStackTrace(stackDescription); |
602 String toString() => _description; | 611 String toString() => _description; |
603 } | 612 } |
604 | 613 |
605 class _RemoteStackTrace implements StackTrace { | 614 class _RemoteStackTrace implements StackTrace { |
606 String _trace; | 615 String _trace; |
607 _RemoteStackTrace(this._trace); | 616 _RemoteStackTrace(this._trace); |
608 String toString() => _trace; | 617 String toString() => _trace; |
609 } | 618 } |
OLD | NEW |