Loading services/input/InputDispatcher.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -238,6 +238,8 @@ void InputDispatcher::dispatchOnce() { nsecs_t nextWakeupTime = LONG_LONG_MAX; { // acquire lock AutoMutex _l(mLock); mDispatcherIsAliveCondition.broadcast(); dispatchOnceInnerLocked(&nextWakeupTime); if (runCommandsLockedInterruptible()) { Loading Loading @@ -4086,6 +4088,8 @@ void InputDispatcher::dump(String8& dump) { void InputDispatcher::monitor() { // Acquire and release the lock to ensure that the dispatcher has not deadlocked. mLock.lock(); mLooper->wake(); mDispatcherIsAliveCondition.wait(mLock); mLock.unlock(); } Loading services/input/InputDispatcher.h +2 −0 Original line number Diff line number Diff line Loading @@ -862,6 +862,8 @@ private: Mutex mLock; Condition mDispatcherIsAliveCondition; sp<Looper> mLooper; EventEntry* mPendingEvent; Loading services/input/InputReader.cpp +8 −3 Original line number Diff line number Diff line Loading @@ -278,18 +278,21 @@ void InputReader::loopOnce() { { // acquire lock AutoMutex _l(mLock); mReaderIsAliveCondition.broadcast(); if (count) { processEventsLocked(mEventBuffer, count); } if (!count || timeoutMillis == 0) { nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC); if (now >= mNextTimeout) { #if DEBUG_RAW_EVENTS ALOGD("Timeout expired, latency=%0.3fms", (now - mNextTimeout) * 0.000001f); #endif mNextTimeout = LLONG_MAX; timeoutExpiredLocked(now); } } } // release lock // Flush queued events out to the listener. Loading Loading @@ -772,6 +775,8 @@ void InputReader::dump(String8& dump) { void InputReader::monitor() { // Acquire and release the lock to ensure that the reader has not deadlocked. mLock.lock(); mEventHub->wake(); mReaderIsAliveCondition.wait(mLock); mLock.unlock(); // Check the EventHub Loading services/input/InputReader.h +2 −0 Original line number Diff line number Diff line Loading @@ -363,6 +363,8 @@ protected: private: Mutex mLock; Condition mReaderIsAliveCondition; sp<EventHubInterface> mEventHub; sp<InputReaderPolicyInterface> mPolicy; sp<QueuedInputListener> mQueuedListener; Loading Loading
services/input/InputDispatcher.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -238,6 +238,8 @@ void InputDispatcher::dispatchOnce() { nsecs_t nextWakeupTime = LONG_LONG_MAX; { // acquire lock AutoMutex _l(mLock); mDispatcherIsAliveCondition.broadcast(); dispatchOnceInnerLocked(&nextWakeupTime); if (runCommandsLockedInterruptible()) { Loading Loading @@ -4086,6 +4088,8 @@ void InputDispatcher::dump(String8& dump) { void InputDispatcher::monitor() { // Acquire and release the lock to ensure that the dispatcher has not deadlocked. mLock.lock(); mLooper->wake(); mDispatcherIsAliveCondition.wait(mLock); mLock.unlock(); } Loading
services/input/InputDispatcher.h +2 −0 Original line number Diff line number Diff line Loading @@ -862,6 +862,8 @@ private: Mutex mLock; Condition mDispatcherIsAliveCondition; sp<Looper> mLooper; EventEntry* mPendingEvent; Loading
services/input/InputReader.cpp +8 −3 Original line number Diff line number Diff line Loading @@ -278,18 +278,21 @@ void InputReader::loopOnce() { { // acquire lock AutoMutex _l(mLock); mReaderIsAliveCondition.broadcast(); if (count) { processEventsLocked(mEventBuffer, count); } if (!count || timeoutMillis == 0) { nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC); if (now >= mNextTimeout) { #if DEBUG_RAW_EVENTS ALOGD("Timeout expired, latency=%0.3fms", (now - mNextTimeout) * 0.000001f); #endif mNextTimeout = LLONG_MAX; timeoutExpiredLocked(now); } } } // release lock // Flush queued events out to the listener. Loading Loading @@ -772,6 +775,8 @@ void InputReader::dump(String8& dump) { void InputReader::monitor() { // Acquire and release the lock to ensure that the reader has not deadlocked. mLock.lock(); mEventHub->wake(); mReaderIsAliveCondition.wait(mLock); mLock.unlock(); // Check the EventHub Loading
services/input/InputReader.h +2 −0 Original line number Diff line number Diff line Loading @@ -363,6 +363,8 @@ protected: private: Mutex mLock; Condition mReaderIsAliveCondition; sp<EventHubInterface> mEventHub; sp<InputReaderPolicyInterface> mPolicy; sp<QueuedInputListener> mQueuedListener; Loading