17 ASSERT(active_list_ ==
nullptr);
20 while (free_list_ !=
nullptr) {
21 Thread* thread = free_list_;
22 free_list_ = thread->next_;
28Thread* ThreadRegistry::GetFreeThreadLocked(
bool is_vm_isolate) {
30 Thread* thread = GetFromFreelistLocked(is_vm_isolate);
33 AddToActiveListLocked(thread);
37void ThreadRegistry::ReturnThreadLocked(Thread* thread) {
40 RemoveFromActiveListLocked(thread);
41 ReturnToFreelistLocked(thread);
49 Thread* thread = active_list_;
50 while (thread !=
nullptr) {
58 thread = thread->next_;
65 Thread* thread = active_list_;
66 while (thread !=
nullptr) {
68 thread = thread->next_;
74 Thread* thread = active_list_;
75 while (thread !=
nullptr) {
79 thread = thread->next_;
85 Thread* thread = active_list_;
86 while (thread !=
nullptr) {
88 thread->AcquireMarkingStacks();
90 thread = thread->next_;
96 Thread* thread = active_list_;
97 while (thread !=
nullptr) {
99 thread->ReleaseMarkingStacks();
102 thread = thread->next_;
108 Thread* thread = active_list_;
109 while (thread !=
nullptr) {
111 thread->FlushMarkingStacks();
114 thread = thread->next_;
118void ThreadRegistry::AddToActiveListLocked(
Thread* thread) {
119 ASSERT(thread !=
nullptr);
121 thread->next_ = active_list_;
122 active_list_ = thread;
126void ThreadRegistry::RemoveFromActiveListLocked(Thread* thread) {
127 ASSERT(thread !=
nullptr);
130 Thread* current = active_list_;
131 while (current !=
nullptr) {
132 if (current == thread) {
133 if (
prev ==
nullptr) {
134 active_list_ = current->next_;
136 prev->next_ = current->next_;
142 current = current->next_;
146Thread* ThreadRegistry::GetFromFreelistLocked(
bool is_vm_isolate) {
150 if (free_list_ ==
nullptr) {
151 thread =
new Thread(is_vm_isolate);
154 free_list_ = thread->next_;
159void ThreadRegistry::ReturnToFreelistLocked(Thread* thread) {
160 ASSERT(thread !=
nullptr);
161 ASSERT(thread->os_thread() ==
nullptr);
162 ASSERT(thread->isolate_ ==
nullptr);
163 ASSERT(thread->isolate_group_ ==
nullptr);
164 ASSERT(thread->field_table_values_ ==
nullptr);
165 ASSERT(thread->shared_field_table_values_ ==
nullptr);
168 thread->next_ = free_list_;
static float prev(float f)
T fetch_add(T arg, std::memory_order order=std::memory_order_relaxed)
T fetch_sub(T arg, std::memory_order order=std::memory_order_relaxed)
void ReleaseStoreBuffers()
void FlushMarkingStacks()
void VisitObjectPointers(IsolateGroup *isolate_group_of_interest, ObjectPointerVisitor *visitor, ValidationPolicy validate_frames)
Monitor * threads_lock() const
void AcquireMarkingStacks()
void ReleaseMarkingStacks()
void ForEachThread(std::function< void(Thread *thread)> callback)
ApiLocalScope * api_top_scope() const
void VisitObjectPointers(ObjectPointerVisitor *visitor, ValidationPolicy validate_frames)
void ReleaseStoreBuffer()
bool IsDartMutatorThread() const
bool BypassSafepoints() const
IsolateGroup * isolate_group() const
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
Dart_NativeFunction function