Chromium Code Reviews| Index: sdk/lib/isolate/base.dart |
| diff --git a/sdk/lib/isolate/base.dart b/sdk/lib/isolate/base.dart |
| index e43e3bbe9b0986ed4c208b6045c07cf861b58c73..a649ab907f85d060df5873dd96401d68d47be16b 100644 |
| --- a/sdk/lib/isolate/base.dart |
| +++ b/sdk/lib/isolate/base.dart |
| @@ -14,7 +14,7 @@ class IsolateSpawnException implements Exception { |
| * the first communication between isolates (see [spawnFunction] and |
| * [spawnUri]). |
| */ |
| -external ReceivePort get port; |
| +ReceivePort get port => _Isolate.port; |
| /** |
| * Creates and spawns an isolate that shares the same code as the current |
| @@ -31,8 +31,8 @@ external ReceivePort get port; |
| * |
| * See comments at the top of this library for more details. |
| */ |
| -// Note this feature is not yet available in the dartvm. |
| -external SendPort spawnFunction(void topLevelFunction()); |
| +SendPort spawnFunction(void topLevelFunction()) |
| + => _Isolate.spawnFunction(topLevelFunction); |
| /** |
| * Creates and spawns an isolate whose code is available at [uri]. Like with |
| @@ -41,7 +41,7 @@ external SendPort spawnFunction(void topLevelFunction()); |
| * |
| * See comments at the top of this library for more details. |
| */ |
| -external SendPort spawnUri(String uri); |
| +SendPort spawnUri(String uri) => _Isolate.spawnUri(uri); |
| /** |
| * [SendPort]s are created from [ReceivePort]s. Any message sent through |
| @@ -142,3 +142,12 @@ abstract class SendPortSync { |
| callSync(var message); |
| } |
| + |
| +// The VM doesn't support accessing external globals in the same library. We |
|
Ivan Posva
2012/11/26 18:56:40
Can you please elaborate what is missing from our
floitsch
2012/11/28 14:13:18
We cannot access external global variables from wi
|
| +// therefore create this wrapper class. |
| +// TODO(floitsch): add bug-number. |
| +abstract class _Isolate { |
| + external static ReceivePort get port; |
| + external static SendPort spawnFunction(void topLevelFunction()); |
| + external static SendPort spawnUri(String uri); |
| +} |