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