void Poll::removeMessages(const MessageHandler& handler, int what) { #if DEBUG_CALLBACKS ALOGD("%p ~ removeMessages - handler=%p, what=%d", this, handler.get(), what); #endif { // acquire lock AutoMutex _l(mLock); //more .... } // release lock }
void Poll::sendMessageAtTime(nsecs_t uptime, const MessageHandler& handler, const Message& message) { #if DEBUG_CALLBACKS ALOGD("%p ~ sendMessageAtTime - uptime=%lld, handler=%p, what=%d", this, uptime, handler.get(), message.what); #endif size_t i = 0; { // acquire lock AutoMutex _l(mLock); //more .... } // release lock // Wake the poll loop only when we enqueue a new message at the head. if (i == 0) { wake(); } }