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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 1748953003: - Add assertions in MutexLocker/MonitorLocker to ensure that the code enclosed (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: code-review-comments Created 4 years, 10 months 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
« no previous file with comments | « no previous file | runtime/vm/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 4aa7c2f4d758a4c733fd245ec2a6dee72cd389aa..4c6fd00ed425d83aa61b7559cfa608e2d41e6db4 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -1610,12 +1610,12 @@ DART_EXPORT Dart_Handle Dart_RunLoop() {
CHECK_API_SCOPE(T);
CHECK_CALLBACK_STATE(T);
API_TIMELINE_BEGIN_END;
- Monitor monitor;
- MonitorLocker ml(&monitor);
+ // The message handler run loop does not expect to have a current isolate
+ // so we exit the isolate here and enter it again after the runloop is done.
+ ::Dart_ExitIsolate();
{
- // The message handler run loop does not expect to have a current isolate
- // so we exit the isolate here and enter it again after the runloop is done.
- Dart_ExitIsolate();
+ Monitor monitor;
+ MonitorLocker ml(&monitor);
RunLoopData data;
data.monitor = &monitor;
data.done = false;
@@ -1625,8 +1625,8 @@ DART_EXPORT Dart_Handle Dart_RunLoop() {
while (!data.done) {
ml.Wait();
}
- ::Dart_EnterIsolate(Api::CastIsolate(I));
}
+ ::Dart_EnterIsolate(Api::CastIsolate(I));
if (T->sticky_error() != Object::null()) {
Dart_Handle error = Api::NewHandle(T, T->sticky_error());
T->clear_sticky_error();
« no previous file with comments | « no previous file | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698