summaryrefslogtreecommitdiff
path: root/runtime/thread.cc
diff options
context:
space:
mode:
author Lokesh Gidra <lokeshgidra@google.com> 2019-12-04 13:46:11 -0800
committer Treehugger Robot <treehugger-gerrit@google.com> 2019-12-05 01:53:26 +0000
commit9317031cd016e02a26cdeea8045df9925b33ffe2 (patch)
treeb1278f6d99c2e4c1375c1d9031d552c9875a4e3c /runtime/thread.cc
parenta0b4631f73547b44bff5c0c01b605d867cd083cc (diff)
Move thread-local mark-stack revocation outside SOA
Revoking mark-stack inside a ScopedObjectAccess scope could potentially call checkpoints in its destructor, which may trigger read-barrier, after the mark-stack is revoked. Test: art/test/testrunner/testrunner.py --target Bug: 140119552 Change-Id: I90d62cbf5edbaf953de73aeb2b3b59612b6897d3
Diffstat (limited to 'runtime/thread.cc')
-rw-r--r--runtime/thread.cc8
1 files changed, 5 insertions, 3 deletions
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);
}
}