ART: Use thread_local on the host for ART Thread*
Use thread_local instead of a pthread key for Thread::Current().
Retain the pthread key as we are still using it for some sanity
checks in ThreadExitCallback.
Bug: 138329277
Test: m test-art-host
Change-Id: Idfe43bc279459e307e2165d3a3762af09230bdfd
diff --git a/runtime/thread-current-inl.h b/runtime/thread-current-inl.h
index 787ec5b..36f767c 100644
--- a/runtime/thread-current-inl.h
+++ b/runtime/thread-current-inl.h
@@ -36,7 +36,7 @@
#ifdef __BIONIC__
void* thread = __get_tls()[TLS_SLOT_ART_THREAD_SELF];
#else
- void* thread = pthread_getspecific(Thread::pthread_key_self_);
+ Thread* thread = Thread::self_tls_;
#endif
return reinterpret_cast<Thread*>(thread);
}