Loading cmds/system_server/library/system_init.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -94,12 +94,12 @@ extern "C" status_t system_init() if (methodId == NULL) { return UNKNOWN_ERROR; } env->CallStaticVoidMethod(clazz, methodId); ALOGI("System server: entering thread pool.\n"); ALOGI("System server: entering thread pool."); ProcessState::self()->startThreadPool(); IPCThreadState::self()->joinThreadPool(); ALOGI("System server: exiting thread pool.\n"); // This is the main thread of the system server, and will never exit. env->CallStaticVoidMethod(clazz, methodId); return NO_ERROR; } core/java/android/os/Looper.java +10 −0 Original line number Diff line number Diff line Loading @@ -289,6 +289,16 @@ public final class Looper { return mQueue; } /** * Return whether this looper's thread is currently idle, waiting for new work * to do. This is intrinsically racy, since its state can change before you get * the result back. * @hide */ public boolean isIdling() { return mQueue.isIdling(); } public void dump(Printer pw, String prefix) { pw = PrefixPrinter.create(pw, prefix); pw.println(this.toString()); Loading core/java/android/os/MessageQueue.java +5 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ public final class MessageQueue { private native static void nativeDestroy(int ptr); private native static void nativePollOnce(int ptr, int timeoutMillis); private native static void nativeWake(int ptr); private native static boolean nativeIsIdling(int ptr); /** * Callback interface for discovering when a thread is going to block Loading Loading @@ -379,6 +380,10 @@ public final class MessageQueue { } } boolean isIdling() { return nativeIsIdling(mPtr); } void removeMessages(Handler h, int what, Object object) { if (h == null) { return; Loading core/jni/android_os_MessageQueue.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -141,6 +141,11 @@ static void android_os_MessageQueue_nativeWake(JNIEnv* env, jclass clazz, jint p return nativeMessageQueue->wake(); } static jboolean android_os_MessageQueue_nativeIsIdling(JNIEnv* env, jclass clazz, jint ptr) { NativeMessageQueue* nativeMessageQueue = reinterpret_cast<NativeMessageQueue*>(ptr); return nativeMessageQueue->getLooper()->isIdling(); } // ---------------------------------------------------------------------------- static JNINativeMethod gMessageQueueMethods[] = { Loading @@ -148,7 +153,8 @@ static JNINativeMethod gMessageQueueMethods[] = { { "nativeInit", "()I", (void*)android_os_MessageQueue_nativeInit }, { "nativeDestroy", "(I)V", (void*)android_os_MessageQueue_nativeDestroy }, { "nativePollOnce", "(II)V", (void*)android_os_MessageQueue_nativePollOnce }, { "nativeWake", "(I)V", (void*)android_os_MessageQueue_nativeWake } { "nativeWake", "(I)V", (void*)android_os_MessageQueue_nativeWake }, { "nativeIsIdling", "(I)Z", (void*)android_os_MessageQueue_nativeIsIdling } }; #define FIND_CLASS(var, className) \ Loading services/java/com/android/server/IoThread.java +2 −2 Original line number Diff line number Diff line Loading @@ -47,14 +47,14 @@ public final class IoThread extends HandlerThread { } public static IoThread get() { synchronized (UiThread.class) { synchronized (IoThread.class) { ensureThreadLocked(); return sInstance; } } public static Handler getHandler() { synchronized (UiThread.class) { synchronized (IoThread.class) { ensureThreadLocked(); return sHandler; } Loading Loading
cmds/system_server/library/system_init.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -94,12 +94,12 @@ extern "C" status_t system_init() if (methodId == NULL) { return UNKNOWN_ERROR; } env->CallStaticVoidMethod(clazz, methodId); ALOGI("System server: entering thread pool.\n"); ALOGI("System server: entering thread pool."); ProcessState::self()->startThreadPool(); IPCThreadState::self()->joinThreadPool(); ALOGI("System server: exiting thread pool.\n"); // This is the main thread of the system server, and will never exit. env->CallStaticVoidMethod(clazz, methodId); return NO_ERROR; }
core/java/android/os/Looper.java +10 −0 Original line number Diff line number Diff line Loading @@ -289,6 +289,16 @@ public final class Looper { return mQueue; } /** * Return whether this looper's thread is currently idle, waiting for new work * to do. This is intrinsically racy, since its state can change before you get * the result back. * @hide */ public boolean isIdling() { return mQueue.isIdling(); } public void dump(Printer pw, String prefix) { pw = PrefixPrinter.create(pw, prefix); pw.println(this.toString()); Loading
core/java/android/os/MessageQueue.java +5 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ public final class MessageQueue { private native static void nativeDestroy(int ptr); private native static void nativePollOnce(int ptr, int timeoutMillis); private native static void nativeWake(int ptr); private native static boolean nativeIsIdling(int ptr); /** * Callback interface for discovering when a thread is going to block Loading Loading @@ -379,6 +380,10 @@ public final class MessageQueue { } } boolean isIdling() { return nativeIsIdling(mPtr); } void removeMessages(Handler h, int what, Object object) { if (h == null) { return; Loading
core/jni/android_os_MessageQueue.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -141,6 +141,11 @@ static void android_os_MessageQueue_nativeWake(JNIEnv* env, jclass clazz, jint p return nativeMessageQueue->wake(); } static jboolean android_os_MessageQueue_nativeIsIdling(JNIEnv* env, jclass clazz, jint ptr) { NativeMessageQueue* nativeMessageQueue = reinterpret_cast<NativeMessageQueue*>(ptr); return nativeMessageQueue->getLooper()->isIdling(); } // ---------------------------------------------------------------------------- static JNINativeMethod gMessageQueueMethods[] = { Loading @@ -148,7 +153,8 @@ static JNINativeMethod gMessageQueueMethods[] = { { "nativeInit", "()I", (void*)android_os_MessageQueue_nativeInit }, { "nativeDestroy", "(I)V", (void*)android_os_MessageQueue_nativeDestroy }, { "nativePollOnce", "(II)V", (void*)android_os_MessageQueue_nativePollOnce }, { "nativeWake", "(I)V", (void*)android_os_MessageQueue_nativeWake } { "nativeWake", "(I)V", (void*)android_os_MessageQueue_nativeWake }, { "nativeIsIdling", "(I)Z", (void*)android_os_MessageQueue_nativeIsIdling } }; #define FIND_CLASS(var, className) \ Loading
services/java/com/android/server/IoThread.java +2 −2 Original line number Diff line number Diff line Loading @@ -47,14 +47,14 @@ public final class IoThread extends HandlerThread { } public static IoThread get() { synchronized (UiThread.class) { synchronized (IoThread.class) { ensureThreadLocked(); return sInstance; } } public static Handler getHandler() { synchronized (UiThread.class) { synchronized (IoThread.class) { ensureThreadLocked(); return sHandler; } Loading