summaryrefslogtreecommitdiff
path: root/runtime/native/java_lang_Thread.cc
diff options
context:
space:
mode:
authorHiroshi Yamauchi <yamauchi@google.com>2015-08-21 16:10:39 -0700
committerHiroshi Yamauchi <yamauchi@google.com>2015-08-27 14:36:01 -0700
commit76f55b030d2517d434f227bee2363c3fb760e5c6 (patch)
tree92d625bb90b05ad976ff174ac25a112a7fda3bd1 /runtime/native/java_lang_Thread.cc
parent24011e738d77dedb28c1b4d6ff34445cc2acc4a7 (diff)
Synchronize JNI critical calls with the CC collector thread flip.
JNI critical calls (like GetArrayElementsCritical) would need to block for the whole GC run to finish if the CC collector GC is ongoing. This CL changes it so that they don't need to block for the GC run, but only for the duration of the thread flip operation, which is much shorter. This is valid due to the to-space invariant. Bug: 12687968 Bug: 19235243 Change-Id: I1b6b4ae4fa539ddc0ec50b10ae8c8709f2a12fe8
Diffstat (limited to 'runtime/native/java_lang_Thread.cc')
-rw-r--r--runtime/native/java_lang_Thread.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/runtime/native/java_lang_Thread.cc b/runtime/native/java_lang_Thread.cc
index c76f6eec73..c75ff78821 100644
--- a/runtime/native/java_lang_Thread.cc
+++ b/runtime/native/java_lang_Thread.cc
@@ -90,6 +90,7 @@ static jint Thread_nativeGetStatus(JNIEnv* env, jobject java_thread, jboolean ha
case kWaitingForMethodTracingStart: return kJavaWaiting;
case kWaitingForVisitObjects: return kJavaWaiting;
case kWaitingWeakGcRootRead: return kJavaWaiting;
+ case kWaitingForGcThreadFlip: return kJavaWaiting;
case kSuspended: return kJavaRunnable;
// Don't add a 'default' here so the compiler can spot incompatible enum changes.
}