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

Unified Diff: runtime/vm/isolate.cc

Issue 1146523003: Fix fall out from hide isolate pointer change (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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 | « runtime/vm/isolate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate.cc
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index d0fa2bf580b75618591044edf97f09ca804cfb51..2f77c59e695043ee2a0cb3f314beba0ab9a2f657 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -1668,7 +1668,8 @@ void Isolate::TrackDeoptimizedCode(const Code& code) {
void Isolate::WakePauseEventHandler(Dart_Isolate isolate) {
- Isolate* iso = reinterpret_cast<Isolate*>(isolate);
+ Isolate* iso = FindIsolateInList(isolate);
+ ASSERT(iso != NULL);
MonitorLocker ml(iso->pause_loop_monitor_);
ml.Notify();
}
@@ -1737,6 +1738,20 @@ intptr_t Isolate::IsolateListLength() {
}
+Isolate* Isolate::FindIsolateInList(Dart_Isolate isolate) {
+ MonitorLocker ml(isolates_list_monitor_);
+ Isolate* current = isolates_list_head_;
+ while (current != NULL) {
+ if (Api::CastIsolate(current) == isolate) {
+ // We've found the isolate.
+ return current;
+ }
+ current = current->next_;
+ }
+ return NULL;
+}
+
+
void Isolate::AddIsolateTolist(Isolate* isolate) {
MonitorLocker ml(isolates_list_monitor_);
ASSERT(isolate != NULL);
« no previous file with comments | « runtime/vm/isolate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698