summaryrefslogtreecommitdiff
path: root/runtime/thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/thread.h')
-rw-r--r--runtime/thread.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/runtime/thread.h b/runtime/thread.h
index a46e799d72..d5fd9e9e51 100644
--- a/runtime/thread.h
+++ b/runtime/thread.h
@@ -359,6 +359,7 @@ class Thread {
uint64_t GetCpuMicroTime() const;
mirror::Object* GetPeer() const REQUIRES_SHARED(Locks::mutator_lock_) {
+ DCHECK(Thread::Current() == this) << "Use GetPeerFromOtherThread instead";
CHECK(tlsPtr_.jpeer == nullptr);
return tlsPtr_.opeer;
}
@@ -1173,6 +1174,12 @@ class Thread {
return false;
}
+ static jobject CreateCompileTimePeer(JNIEnv* env,
+ const char* name,
+ bool as_daemon,
+ jobject thread_group)
+ REQUIRES_SHARED(Locks::mutator_lock_);
+
private:
explicit Thread(bool daemon);
~Thread() REQUIRES(!Locks::mutator_lock_, !Locks::thread_suspend_count_lock_);
@@ -1188,8 +1195,12 @@ class Thread {
void CreatePeer(const char* name, bool as_daemon, jobject thread_group);
template<bool kTransactionActive>
- void InitPeer(ScopedObjectAccess& soa, jboolean thread_is_daemon, jobject thread_group,
- jobject thread_name, jint thread_priority)
+ static void InitPeer(ScopedObjectAccessAlreadyRunnable& soa,
+ ObjPtr<mirror::Object> peer,
+ jboolean thread_is_daemon,
+ jobject thread_group,
+ jobject thread_name,
+ jint thread_priority)
REQUIRES_SHARED(Locks::mutator_lock_);
// Avoid use, callers should use SetState. Used only by SignalCatcher::HandleSigQuit, ~Thread and