Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(450)

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 8851008: Add support for interrupting an isolate in the vm. Interrupts are (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();

Powered by Google App Engine
This is Rietveld 408576698