From 76f55b030d2517d434f227bee2363c3fb760e5c6 Mon Sep 17 00:00:00 2001 From: Hiroshi Yamauchi Date: Fri, 21 Aug 2015 16:10:39 -0700 Subject: 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 --- runtime/native/java_lang_Thread.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime/native/java_lang_Thread.cc') 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. } -- cgit v1.2.3-59-g8ed1b