Index: runtime/vm/dart_api_impl.cc |
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc |
index 47a410f7630531cf08574c11142cf5dfaf1f8ab1..952a246c08b8accca628607f3e488e229dd868f4 100644 |
--- a/runtime/vm/dart_api_impl.cc |
+++ b/runtime/vm/dart_api_impl.cc |
@@ -1601,7 +1601,13 @@ DART_EXPORT void Dart_InterruptIsolate(Dart_Isolate isolate) { |
} |
// TODO(16615): Validate isolate parameter. |
Isolate* iso = reinterpret_cast<Isolate*>(isolate); |
+ // Schedule the interrupt. The isolate will notice this bit being set if it |
+ // is currently executing in Dart code. |
iso->ScheduleInterrupts(Isolate::kApiInterrupt); |
+ // If the isolate is blocked on the message queue, we post an dummy message |
koda
2015/08/19 00:29:46
"an dummy" -> "a dummy"
Ivan Posva
2015/08/19 08:29:17
Done.
|
+ // to the isolate's main port. The message will be ultimately ignored, but as |
+ // part of handling the message the interrupt bit which was set above will be |
+ // honored. |
// Can't use Dart_Post() since there isn't a current isolate. |
Dart_CObject api_null = { Dart_CObject_kNull , { 0 } }; |
Dart_PostCObject(iso->main_port(), &api_null); |