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

Unified Diff: runtime/vm/thread_registry.h

Issue 1473403003: Move ApiLocalScope out of class ApiState into class Thread so that the API local handles and zone e… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: code-review-patch Created 5 years, 1 month 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/thread.cc ('k') | runtime/vm/thread_registry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread_registry.h
diff --git a/runtime/vm/thread_registry.h b/runtime/vm/thread_registry.h
index 6c334634ca074fc6ff65de59ad03ec9b46f73383..f077c517be26fd33916c2db4c389e902d0ccdaf8 100644
--- a/runtime/vm/thread_registry.h
+++ b/runtime/vm/thread_registry.h
@@ -73,11 +73,17 @@ class ThreadRegistry {
Thread* free_list_; // Free list of Thread objects that can be reused.
// TODO(asiva): Currently we treat a mutator thread as a special thread
// and always schedule execution of Dart code on the same mutator thread
- // object. This is because ApiState is still an object associated with
- // the isolate and switching execution to another thread causes problems.
- // Once ApiState is made a per Thread object it should be possible to
- // free a mutator thread like all other threads and continue running on
- // a different thread.
+ // object. The ApiLocalScope has been made thread specific but we still
+ // have scenarios where we do a temporary exit of an Isolate with live
+ // zones/handles in the the API scope :
+ // - Dart_RunLoop()
+ // - IsolateSaver in Dart_NewNativePort
+ // - Isolate spawn (function/uri) under FLAG_i_like_slow_isolate_spawn
+ // We probably need a mechanism to return to the specific thread only
+ // for these specific cases. We should also determine if the embedder
+ // should allow exiting an isolate with live state in zones/handles in
+ // which case a new API for returning to the specific thread needs to be
+ // added.
Thread* mutator_thread_;
// Safepoint rendezvous state.
« no previous file with comments | « runtime/vm/thread.cc ('k') | runtime/vm/thread_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698