Make sure threads allocating are in the kRunnable state
Change-Id: I55a08fcd38b3388698ef571d2d4fa9553210e197
diff --git a/src/dalvik_system_DexFile.cc b/src/dalvik_system_DexFile.cc
index 40a1626..6ad92ba 100644
--- a/src/dalvik_system_DexFile.cc
+++ b/src/dalvik_system_DexFile.cc
@@ -154,6 +154,7 @@
}
jclass DexFile_defineClass(JNIEnv* env, jclass, jstring javaName, jobject javaLoader, jint cookie) {
+ ScopedThreadStateChange tsc(Thread::Current(), Thread::kRunnable);
const DexFile* dex_file = toDexFile(env, cookie);
if (dex_file == NULL) {
return NULL;