diff options
Diffstat (limited to 'include/utils/Looper.h')
-rw-r--r-- | include/utils/Looper.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/utils/Looper.h b/include/utils/Looper.h index d4a0067..2e0651a 100644 --- a/include/utils/Looper.h +++ b/include/utils/Looper.h @@ -297,6 +297,13 @@ public: void removeMessages(const sp<MessageHandler>& handler, int what); /** + * Return whether this looper's thread is currently idling -- that is, whether it + * stopped waiting for more work to do. Note that this is intrinsically racy, since + * its state can change before you get the result back. + */ + bool isIdling() const; + + /** * Prepares a looper associated with the calling thread, and returns it. * If the thread already has a looper, it is returned. Otherwise, a new * one is created, associated with the thread, and returned. @@ -353,6 +360,10 @@ private: Vector<MessageEnvelope> mMessageEnvelopes; // guarded by mLock bool mSendingMessage; // guarded by mLock + // Whether we are currently waiting for work. Not protected by a lock, + // any use of it is racy anyway. + volatile bool mIdling; + int mEpollFd; // immutable // Locked list of file descriptor monitoring requests. |