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

Side by Side Diff: runtime/vm/thread.cc

Issue 1806093002: Clear reusable handles of helper threads as well. Visit mutator_thread_ even if it is not active (a… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/thread_registry.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "vm/thread.h" 5 #include "vm/thread.h"
6 6
7 #include "vm/dart_api_state.h" 7 #include "vm/dart_api_state.h"
8 #include "vm/growable_array.h" 8 #include "vm/growable_array.h"
9 #include "vm/isolate.h" 9 #include "vm/isolate.h"
10 #include "vm/lockers.h" 10 #include "vm/lockers.h"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 } 255 }
256 return false; 256 return false;
257 } 257 }
258 258
259 259
260 void Thread::ExitIsolateAsHelper(bool bypass_safepoint) { 260 void Thread::ExitIsolateAsHelper(bool bypass_safepoint) {
261 Thread* thread = Thread::Current(); 261 Thread* thread = Thread::Current();
262 ASSERT(thread != NULL); 262 ASSERT(thread != NULL);
263 ASSERT(!thread->IsMutatorThread()); 263 ASSERT(!thread->IsMutatorThread());
264 ASSERT(thread->execution_state() == Thread::kThreadInVM); 264 ASSERT(thread->execution_state() == Thread::kThreadInVM);
265 // Clear since GC will not visit the thread once it is unscheduled.
266 thread->ClearReusableHandles();
265 thread->StoreBufferRelease(); 267 thread->StoreBufferRelease();
266 Isolate* isolate = thread->isolate(); 268 Isolate* isolate = thread->isolate();
267 ASSERT(isolate != NULL); 269 ASSERT(isolate != NULL);
268 const bool kIsNotMutatorThread = false; 270 const bool kIsNotMutatorThread = false;
269 isolate->UnscheduleThread(thread, kIsNotMutatorThread, bypass_safepoint); 271 isolate->UnscheduleThread(thread, kIsNotMutatorThread, bypass_safepoint);
270 } 272 }
271 273
272 274
273 void Thread::PrepareForGC() { 275 void Thread::PrepareForGC() {
274 ASSERT(IsAtSafepoint()); 276 ASSERT(IsAtSafepoint());
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 506
505 DisableThreadInterruptsScope::~DisableThreadInterruptsScope() { 507 DisableThreadInterruptsScope::~DisableThreadInterruptsScope() {
506 if (thread() != NULL) { 508 if (thread() != NULL) {
507 OSThread* os_thread = thread()->os_thread(); 509 OSThread* os_thread = thread()->os_thread();
508 ASSERT(os_thread != NULL); 510 ASSERT(os_thread != NULL);
509 os_thread->EnableThreadInterrupts(); 511 os_thread->EnableThreadInterrupts();
510 } 512 }
511 } 513 }
512 514
513 } // namespace dart 515 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/thread_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698