OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 #ifndef RUNTIME_VM_THREAD_REGISTRY_H_ | 5 #ifndef RUNTIME_VM_THREAD_REGISTRY_H_ |
6 #define RUNTIME_VM_THREAD_REGISTRY_H_ | 6 #define RUNTIME_VM_THREAD_REGISTRY_H_ |
7 | 7 |
8 #include "vm/globals.h" | 8 #include "vm/globals.h" |
9 #include "vm/growable_array.h" | 9 #include "vm/growable_array.h" |
10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 Thread* free_list_; // Free list of Thread objects that can be reused. | 61 Thread* free_list_; // Free list of Thread objects that can be reused. |
62 | 62 |
63 // TODO(asiva): Currently we treat a mutator thread as a special thread | 63 // TODO(asiva): Currently we treat a mutator thread as a special thread |
64 // and always schedule execution of Dart code on the same mutator thread | 64 // and always schedule execution of Dart code on the same mutator thread |
65 // object. The ApiLocalScope has been made thread specific but we still | 65 // object. The ApiLocalScope has been made thread specific but we still |
66 // have scenarios where we do a temporary exit of an Isolate with live | 66 // have scenarios where we do a temporary exit of an Isolate with live |
67 // zones/handles in the API scope : | 67 // zones/handles in the API scope : |
68 // - Dart_RunLoop() | 68 // - Dart_RunLoop() |
69 // - IsolateSaver in Dart_NewNativePort | 69 // - IsolateSaver in Dart_NewNativePort |
70 // - Isolate spawn (function/uri) under FLAG_i_like_slow_isolate_spawn | 70 // - Isolate spawn (function/uri) under FLAG_i_like_slow_isolate_spawn |
| 71 // Similarly, tracking async_stack_trace requires that we always reschedule |
| 72 // on the same thread. |
71 // We probably need a mechanism to return to the specific thread only | 73 // We probably need a mechanism to return to the specific thread only |
72 // for these specific cases. We should also determine if the embedder | 74 // for these specific cases. We should also determine if the embedder |
73 // should allow exiting an isolate with live state in zones/handles in | 75 // should allow exiting an isolate with live state in zones/handles in |
74 // which case a new API for returning to the specific thread needs to be | 76 // which case a new API for returning to the specific thread needs to be |
75 // added. | 77 // added. |
76 Thread* mutator_thread_; | 78 Thread* mutator_thread_; |
77 | 79 |
78 friend class Isolate; | 80 friend class Isolate; |
79 friend class SafepointHandler; | 81 friend class SafepointHandler; |
80 DISALLOW_COPY_AND_ASSIGN(ThreadRegistry); | 82 DISALLOW_COPY_AND_ASSIGN(ThreadRegistry); |
81 }; | 83 }; |
82 | 84 |
83 } // namespace dart | 85 } // namespace dart |
84 | 86 |
85 #endif // RUNTIME_VM_THREAD_REGISTRY_H_ | 87 #endif // RUNTIME_VM_THREAD_REGISTRY_H_ |
OLD | NEW |