summaryrefslogtreecommitdiff
path: root/runtime/thread.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/thread.cc')
-rw-r--r--runtime/thread.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/runtime/thread.cc b/runtime/thread.cc
index 36ecd3398c..fc30832189 100644
--- a/runtime/thread.cc
+++ b/runtime/thread.cc
@@ -2134,6 +2134,10 @@ void Thread::Destroy() {
ScopedObjectAccess soa(self);
// We may need to call user-supplied managed code, do this before final clean-up.
HandleUncaughtExceptions(soa);
+ Runtime* runtime = Runtime::Current();
+ if (runtime != nullptr) {
+ runtime->GetRuntimeCallbacks()->ThreadDeath(self);
+ }
RemoveFromThreadGroup(soa);
// this.nativePeer = 0;
@@ -2144,11 +2148,6 @@ void Thread::Destroy() {
jni::DecodeArtField(WellKnownClasses::java_lang_Thread_nativePeer)
->SetLong<false>(tlsPtr_.opeer, 0);
}
- Runtime* runtime = Runtime::Current();
- if (runtime != nullptr) {
- runtime->GetRuntimeCallbacks()->ThreadDeath(self);
- }
-
// Thread.join() is implemented as an Object.wait() on the Thread.lock object. Signal anyone
// who is waiting.