summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Brown2015-02-26 16:16:30 -0600
committerJeff Brown2015-03-11 17:00:36 -0500
commit27e5721860142b1b20081b535c55e7917366385f (patch)
tree1f9e7bc2331e0ba78aac23880982c65da85ea412 /libutils/Looper.cpp
parent40ed4f5d5ea0f9fa38ecbaa5fed7163b72e90063 (diff)
downloadplatform-system-core-27e5721860142b1b20081b535c55e7917366385f.tar.gz
platform-system-core-27e5721860142b1b20081b535c55e7917366385f.tar.xz
platform-system-core-27e5721860142b1b20081b535c55e7917366385f.zip
Rename Looper::isIdling() to isPolling() to resolve confusion.
The loop isn't technically idle at this time, it's just checking whether any file descriptors have pending events. However it's still a good signal as to whether the loop is alive. Bug: 19532373 Change-Id: I555c473e70ffd8a56e1b10aa60026eb674a16de9
Diffstat (limited to 'libutils/Looper.cpp')
-rw-r--r--libutils/Looper.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/libutils/Looper.cpp b/libutils/Looper.cpp
index 9a2dd6cc4..9ba17970b 100644
--- a/libutils/Looper.cpp
+++ b/libutils/Looper.cpp
@@ -84,7 +84,7 @@ Looper::Looper(bool allowNonCallbacks) :
84 LOG_ALWAYS_FATAL_IF(result != 0, "Could not make wake write pipe non-blocking. errno=%d", 84 LOG_ALWAYS_FATAL_IF(result != 0, "Could not make wake write pipe non-blocking. errno=%d",
85 errno); 85 errno);
86 86
87 mIdling = false; 87 mPolling = false;
88 88
89 // Allocate the epoll instance and register the wake pipe. 89 // Allocate the epoll instance and register the wake pipe.
90 mEpollFd = epoll_create(EPOLL_SIZE_HINT); 90 mEpollFd = epoll_create(EPOLL_SIZE_HINT);
@@ -217,13 +217,13 @@ int Looper::pollInner(int timeoutMillis) {
217 mResponseIndex = 0; 217 mResponseIndex = 0;
218 218
219 // We are about to idle. 219 // We are about to idle.
220 mIdling = true; 220 mPolling = true;
221 221
222 struct epoll_event eventItems[EPOLL_MAX_EVENTS]; 222 struct epoll_event eventItems[EPOLL_MAX_EVENTS];
223 int eventCount = epoll_wait(mEpollFd, eventItems, EPOLL_MAX_EVENTS, timeoutMillis); 223 int eventCount = epoll_wait(mEpollFd, eventItems, EPOLL_MAX_EVENTS, timeoutMillis);
224 224
225 // No longer idling. 225 // No longer idling.
226 mIdling = false; 226 mPolling = false;
227 227
228 // Acquire lock. 228 // Acquire lock.
229 mLock.lock(); 229 mLock.lock();
@@ -566,8 +566,8 @@ void Looper::removeMessages(const sp<MessageHandler>& handler, int what) {
566 } // release lock 566 } // release lock
567} 567}
568 568
569bool Looper::isIdling() const { 569bool Looper::isPolling() const {
570 return mIdling; 570 return mPolling;
571} 571}
572 572
573} // namespace android 573} // namespace android