Index: runtime/vm/dart_api_impl.cc |
=================================================================== |
--- runtime/vm/dart_api_impl.cc (revision 2528) |
+++ runtime/vm/dart_api_impl.cc (working copy) |
@@ -528,9 +528,9 @@ |
// --- Initialization and Globals --- |
-// TODO(iposva): This is a placeholder for the eventual external Dart API. |
-DART_EXPORT bool Dart_Initialize(Dart_IsolateCreateCallback callback) { |
- return Dart::InitOnce(callback); |
+DART_EXPORT bool Dart_Initialize(Dart_IsolateCreateCallback create, |
+ Dart_IsolateInterruptCallback interrupt) { |
+ return Dart::InitOnce(create, interrupt); |
} |
DART_EXPORT bool Dart_SetVMFlags(int argc, const char** argv) { |
@@ -663,6 +663,15 @@ |
} |
+DART_EXPORT void Dart_InterruptIsolate(Dart_Isolate isolate) { |
+ if (isolate == NULL) { |
+ FATAL1("%s expects argument 'isolate' to be non-null.", CURRENT_FUNC); |
+ } |
+ Isolate* iso = reinterpret_cast<Isolate*>(isolate); |
+ iso->ScheduleInterrupts(Isolate::kApiInterrupt); |
+} |
+ |
+ |
// --- Messages and Ports --- |
@@ -1222,7 +1231,7 @@ |
CURRENT_FUNC); |
} |
if (peer == NULL) { |
- return Api::Error("%s expects argument 'peer' to be non-NULL.", |
+ return Api::Error("%s expects argument 'peer' to be non-null.", |
CURRENT_FUNC); |
} |
*peer = str.GetPeer(); |