diff options
-rw-r--r-- | runtime/gc/collector/concurrent_copying.h | 3 | ||||
-rw-r--r-- | runtime/thread.cc | 8 |
2 files changed, 6 insertions, 5 deletions
diff --git a/runtime/gc/collector/concurrent_copying.h b/runtime/gc/collector/concurrent_copying.h index dd295d153f..0240460874 100644 --- a/runtime/gc/collector/concurrent_copying.h +++ b/runtime/gc/collector/concurrent_copying.h @@ -150,8 +150,7 @@ class ConcurrentCopying : public GarbageCollector { bool IsWeakRefAccessEnabled() REQUIRES(Locks::thread_list_lock_) { return weak_ref_access_enabled_; } - void RevokeThreadLocalMarkStack(Thread* thread) REQUIRES_SHARED(Locks::mutator_lock_) - REQUIRES(!mark_stack_lock_); + void RevokeThreadLocalMarkStack(Thread* thread) REQUIRES(!mark_stack_lock_); mirror::Object* IsMarked(mirror::Object* from_ref) override REQUIRES_SHARED(Locks::mutator_lock_); diff --git a/runtime/thread.cc b/runtime/thread.cc index 290b87f496..59a170517c 100644 --- a/runtime/thread.cc +++ b/runtime/thread.cc @@ -2439,9 +2439,11 @@ void Thread::Destroy() { { ScopedObjectAccess soa(self); Runtime::Current()->GetHeap()->RevokeThreadLocalBuffers(this); - if (kUseReadBarrier) { - Runtime::Current()->GetHeap()->ConcurrentCopyingCollector()->RevokeThreadLocalMarkStack(this); - } + } + // Mark-stack revocation must be performed at the very end. No + // checkpoint/flip-function or read-barrier should be called after this. + if (kUseReadBarrier) { + Runtime::Current()->GetHeap()->ConcurrentCopyingCollector()->RevokeThreadLocalMarkStack(this); } } |