From ffb0f9b345f419a0d2be2a3ccc376e4d7e2c0884 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Mon, 29 Sep 2014 11:08:41 -0600 Subject: [PATCH] provide slightly more complete Thread.nativeGetStatus implementation This fixes SimpleFramework (which depends on Thread.getState returning Thread.State.NEW for unstarted threads) when using the Android class library. --- src/classpath-android.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/classpath-android.cpp b/src/classpath-android.cpp index f8a2883611..0d71913b0d 100644 --- a/src/classpath-android.cpp +++ b/src/classpath-android.cpp @@ -965,10 +965,14 @@ extern "C" AVIAN_EXPORT int64_t JNICALL } extern "C" AVIAN_EXPORT int64_t JNICALL - Avian_java_lang_Thread_nativeGetStatus(Thread*, object, uintptr_t*) + Avian_java_lang_Thread_nativeGetStatus(Thread*, + object, + uintptr_t* arguments) { - // todo - return 1; + enum { New, Runnable, Blocked, Waiting, TimedWaiting, Terminated }; + + // todo: more detail? (e.g. waiting, terminated, etc.) + return arguments[1] ? Runnable : New; } extern "C" AVIAN_EXPORT int64_t JNICALL