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

Side by Side Diff: runtime/vm/dart_api_impl.cc

Issue 1260283007: Fix race and limit access to mutator_thread_. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Remove debug print. Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/isolate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "include/dart_api.h" 5 #include "include/dart_api.h"
6 #include "include/dart_mirrors_api.h" 6 #include "include/dart_mirrors_api.h"
7 #include "include/dart_native_api.h" 7 #include "include/dart_native_api.h"
8 8
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1435 DARTSCOPE(isolate); 1435 DARTSCOPE(isolate);
1436 return Api::NewHandle(isolate, String::New(isolate->name())); 1436 return Api::NewHandle(isolate, String::New(isolate->name()));
1437 } 1437 }
1438 1438
1439 1439
1440 1440
1441 DART_EXPORT void Dart_EnterIsolate(Dart_Isolate isolate) { 1441 DART_EXPORT void Dart_EnterIsolate(Dart_Isolate isolate) {
1442 CHECK_NO_ISOLATE(Isolate::Current()); 1442 CHECK_NO_ISOLATE(Isolate::Current());
1443 // TODO(16615): Validate isolate parameter. 1443 // TODO(16615): Validate isolate parameter.
1444 Isolate* iso = reinterpret_cast<Isolate*>(isolate); 1444 Isolate* iso = reinterpret_cast<Isolate*>(isolate);
1445 if (iso->mutator_thread() != NULL) { 1445 if (iso->HasMutatorThread()) {
1446 FATAL("Multiple mutators within one isolate is not supported."); 1446 FATAL("Multiple mutators within one isolate is not supported.");
1447 } 1447 }
1448 Thread::EnsureInit(); 1448 Thread::EnsureInit();
1449 Thread::EnterIsolate(iso); 1449 Thread::EnterIsolate(iso);
1450 } 1450 }
1451 1451
1452 1452
1453 DART_EXPORT void Dart_IsolateBlocked() { 1453 DART_EXPORT void Dart_IsolateBlocked() {
1454 Isolate* isolate = Isolate::Current(); 1454 Isolate* isolate = Isolate::Current();
1455 CHECK_ISOLATE(isolate); 1455 CHECK_ISOLATE(isolate);
(...skipping 4404 matching lines...) Expand 10 before | Expand all | Expand 10 after
5860 ASSERT(stream != NULL); 5860 ASSERT(stream != NULL);
5861 TimelineEvent* event = stream->StartEvent(); 5861 TimelineEvent* event = stream->StartEvent();
5862 if (event != NULL) { 5862 if (event != NULL) {
5863 event->AsyncEnd(label, async_id); 5863 event->AsyncEnd(label, async_id);
5864 event->Complete(); 5864 event->Complete();
5865 } 5865 }
5866 return Api::Success(); 5866 return Api::Success();
5867 } 5867 }
5868 5868
5869 } // namespace dart 5869 } // namespace dart
OLDNEW
« 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