Loading include/utils/Looper.h +9 −6 Original line number Diff line number Diff line Loading @@ -83,16 +83,20 @@ public: * This method does not return until it has finished invoking the appropriate callbacks * for all file descriptors that were signalled. */ int pollOnce(int timeoutMillis, int* outFd = NULL, int* outEvents = NULL, void** outData = NULL); int pollOnce(int timeoutMillis, int* outFd, int* outEvents, void** outData); inline int pollOnce(int timeoutMillis) { return pollOnce(timeoutMillis, NULL, NULL, NULL); } /** * Like pollOnce(), but performs all pending callbacks until all * data has been consumed or a file descriptor is available with no callback. * This function will never return ALOOPER_POLL_CALLBACK. */ int pollAll(int timeoutMillis, int* outFd = NULL, int* outEvents = NULL, void** outData = NULL); int pollAll(int timeoutMillis, int* outFd, int* outEvents, void** outData); inline int pollAll(int timeoutMillis) { return pollAll(timeoutMillis, NULL, NULL, NULL); } /** * Wakes the poll asynchronously. Loading Loading @@ -128,8 +132,7 @@ public: * This method can be called on any thread. * This method may block briefly if it needs to wake the poll. */ int addFd(int fd, int ident, int events, ALooper_callbackFunc callback, void* data = NULL); int addFd(int fd, int ident, int events, ALooper_callbackFunc callback, void* data); /** * Removes a previously added file descriptor from the looper. 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 services/surfaceflinger/Layer.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -380,6 +380,7 @@ sp<GraphicBuffer> Layer::requestBuffer(int index, mReqWidth = reqWidth; mReqHeight = reqHeight; mReqFormat = reqFormat; mFixedSize = reqWidth && reqHeight; lcblk->reallocateAllExcept(index); } Loading Loading
include/utils/Looper.h +9 −6 Original line number Diff line number Diff line Loading @@ -83,16 +83,20 @@ public: * This method does not return until it has finished invoking the appropriate callbacks * for all file descriptors that were signalled. */ int pollOnce(int timeoutMillis, int* outFd = NULL, int* outEvents = NULL, void** outData = NULL); int pollOnce(int timeoutMillis, int* outFd, int* outEvents, void** outData); inline int pollOnce(int timeoutMillis) { return pollOnce(timeoutMillis, NULL, NULL, NULL); } /** * Like pollOnce(), but performs all pending callbacks until all * data has been consumed or a file descriptor is available with no callback. * This function will never return ALOOPER_POLL_CALLBACK. */ int pollAll(int timeoutMillis, int* outFd = NULL, int* outEvents = NULL, void** outData = NULL); int pollAll(int timeoutMillis, int* outFd, int* outEvents, void** outData); inline int pollAll(int timeoutMillis) { return pollAll(timeoutMillis, NULL, NULL, NULL); } /** * Wakes the poll asynchronously. Loading Loading @@ -128,8 +132,7 @@ public: * This method can be called on any thread. * This method may block briefly if it needs to wake the poll. */ int addFd(int fd, int ident, int events, ALooper_callbackFunc callback, void* data = NULL); int addFd(int fd, int ident, int events, ALooper_callbackFunc callback, void* data); /** * Removes a previously added file descriptor from the looper. 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
services/surfaceflinger/Layer.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -380,6 +380,7 @@ sp<GraphicBuffer> Layer::requestBuffer(int index, mReqWidth = reqWidth; mReqHeight = reqHeight; mReqFormat = reqFormat; mFixedSize = reqWidth && reqHeight; lcblk->reallocateAllExcept(index); } Loading