Loading libs/utils/Looper.cpp +38 −32 Original line number Diff line number Diff line Loading @@ -184,8 +184,7 @@ int Looper::pollInner(int timeoutMillis) { #if DEBUG_POLL_AND_WAKE LOGD("%p ~ pollOnce - handling events from %d fds", this, eventCount); #endif { // acquire lock AutoMutex _l(mLock); bool acquiredLock = false; for (int i = 0; i < eventCount; i++) { int fd = eventItems[i].data.fd; uint32_t epollEvents = eventItems[i].events; Loading @@ -203,6 +202,11 @@ int Looper::pollInner(int timeoutMillis) { LOGW("Ignoring unexpected epoll events 0x%x on wake read pipe.", epollEvents); } } else { if (! acquiredLock) { mLock.lock(); acquiredLock = true; } ssize_t requestIndex = mRequests.indexOfKey(fd); if (requestIndex >= 0) { int events = 0; Loading @@ -221,6 +225,8 @@ int Looper::pollInner(int timeoutMillis) { } } } if (acquiredLock) { mLock.unlock(); } for (size_t i = 0; i < mResponses.size(); i++) { Loading Loading
libs/utils/Looper.cpp +38 −32 Original line number Diff line number Diff line Loading @@ -184,8 +184,7 @@ int Looper::pollInner(int timeoutMillis) { #if DEBUG_POLL_AND_WAKE LOGD("%p ~ pollOnce - handling events from %d fds", this, eventCount); #endif { // acquire lock AutoMutex _l(mLock); bool acquiredLock = false; for (int i = 0; i < eventCount; i++) { int fd = eventItems[i].data.fd; uint32_t epollEvents = eventItems[i].events; Loading @@ -203,6 +202,11 @@ int Looper::pollInner(int timeoutMillis) { LOGW("Ignoring unexpected epoll events 0x%x on wake read pipe.", epollEvents); } } else { if (! acquiredLock) { mLock.lock(); acquiredLock = true; } ssize_t requestIndex = mRequests.indexOfKey(fd); if (requestIndex >= 0) { int events = 0; Loading @@ -221,6 +225,8 @@ int Looper::pollInner(int timeoutMillis) { } } } if (acquiredLock) { mLock.unlock(); } for (size_t i = 0; i < mResponses.size(); i++) { Loading