diff options
Diffstat (limited to 'openjdkjvm/OpenjdkJvm.cc')
-rw-r--r-- | openjdkjvm/OpenjdkJvm.cc | 38 |
1 files changed, 6 insertions, 32 deletions
diff --git a/openjdkjvm/OpenjdkJvm.cc b/openjdkjvm/OpenjdkJvm.cc index a9fa0fc6c7..63503f459e 100644 --- a/openjdkjvm/OpenjdkJvm.cc +++ b/openjdkjvm/OpenjdkJvm.cc @@ -406,38 +406,12 @@ JNIEXPORT jboolean JVM_HoldsLock(JNIEnv* env, jclass unused ATTRIBUTE_UNUSED, jo return soa.Self()->HoldsLock(object); } -JNIEXPORT void JVM_SetNativeThreadName(JNIEnv* env, jobject jthread, jstring java_name) { - ScopedUtfChars name(env, java_name); - { - art::ScopedObjectAccess soa(env); - if (soa.Decode<art::mirror::Object>(jthread) == soa.Self()->GetPeer()) { - soa.Self()->SetThreadName(name.c_str()); - return; - } - } - // Suspend thread to avoid it from killing itself while we set its name. We don't just hold the - // thread list lock to avoid this, as setting the thread name causes mutator to lock/unlock - // in the DDMS send code. - art::ThreadList* thread_list = art::Runtime::Current()->GetThreadList(); - bool timed_out; - // Take suspend thread lock to avoid races with threads trying to suspend this one. - art::Thread* thread; - { - thread = thread_list->SuspendThreadByPeer(jthread, - art::SuspendReason::kInternal, - &timed_out); - } - if (thread != nullptr) { - { - art::ScopedObjectAccess soa(env); - thread->SetThreadName(name.c_str()); - } - bool resumed = thread_list->Resume(thread, art::SuspendReason::kInternal); - DCHECK(resumed); - } else if (timed_out) { - LOG(ERROR) << "Trying to set thread name to '" << name.c_str() << "' failed as the thread " - "failed to suspend within a generous timeout."; - } +JNIEXPORT __attribute__((noreturn)) void JVM_SetNativeThreadName( + JNIEnv* env ATTRIBUTE_UNUSED, + jobject jthread ATTRIBUTE_UNUSED, + jstring java_name ATTRIBUTE_UNUSED) { + UNIMPLEMENTED(FATAL) << "JVM_SetNativeThreadName is not implemented"; + UNREACHABLE(); } JNIEXPORT __attribute__((noreturn)) jint JVM_IHashCode(JNIEnv* env ATTRIBUTE_UNUSED, |