Merge "Fix a race condition during the rosalloc verification."
diff --git a/runtime/thread.cc b/runtime/thread.cc
index 2308cc9..4a7103b 100644
--- a/runtime/thread.cc
+++ b/runtime/thread.cc
@@ -1210,7 +1210,10 @@
     tlsPtr_.opeer = nullptr;
   }
 
-  Runtime::Current()->GetHeap()->RevokeThreadLocalBuffers(this);
+  {
+    ScopedObjectAccess soa(self);
+    Runtime::Current()->GetHeap()->RevokeThreadLocalBuffers(this);
+  }
 }
 
 Thread::~Thread() {