summaryrefslogtreecommitdiff
path: root/runtime/openjdkjvm/OpenjdkJvm.cc
diff options
context:
space:
mode:
authorAlex Light <allight@google.com>2017-06-29 11:59:50 -0700
committerAlex Light <allight@google.com>2017-06-30 14:24:56 +0000
commit46f9340f2a055a8fdfebbfbb739c697c20d83e7c (patch)
treeacb172f74723e4ea9ac7ded73b94c661217ec90d /runtime/openjdkjvm/OpenjdkJvm.cc
parentfe9a4f061841a3c597aac6817a47c799c54fcad7 (diff)
Add SuspendReason enum and change Suspension functions.
More self-documenting and more type safe. Bug: 62821960 Test: ./test.py Change-Id: Ic7a1ae6a25e687d65f5aa10c1aad54a7b80dd086
Diffstat (limited to 'runtime/openjdkjvm/OpenjdkJvm.cc')
-rw-r--r--runtime/openjdkjvm/OpenjdkJvm.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/runtime/openjdkjvm/OpenjdkJvm.cc b/runtime/openjdkjvm/OpenjdkJvm.cc
index 0b93b079d5..4560dda4dd 100644
--- a/runtime/openjdkjvm/OpenjdkJvm.cc
+++ b/runtime/openjdkjvm/OpenjdkJvm.cc
@@ -422,14 +422,17 @@ JNIEXPORT void JVM_SetNativeThreadName(JNIEnv* env, jobject jthread, jstring jav
// Take suspend thread lock to avoid races with threads trying to suspend this one.
art::Thread* thread;
{
- thread = thread_list->SuspendThreadByPeer(jthread, true, false, &timed_out);
+ thread = thread_list->SuspendThreadByPeer(jthread,
+ true,
+ art::SuspendReason::kInternal,
+ &timed_out);
}
if (thread != NULL) {
{
art::ScopedObjectAccess soa(env);
thread->SetThreadName(name.c_str());
}
- thread_list->Resume(thread, false);
+ thread_list->Resume(thread, art::SuspendReason::kInternal);
} 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.";