Home | History | Annotate | Download | only in libutils

Lines Matching defs:looper

4 // A looper implementation based on epoll().
6 #define LOG_TAG "Looper"
16 #include <utils/Looper.h>
52 // --- Looper ---
63 Looper::Looper(bool allowNonCallbacks) :
75 Looper::~Looper() {
83 void Looper::initTLSKey() {
88 void Looper::threadDestructor(void *st) {
89 Looper* const self = static_cast<Looper*>(st);
95 void Looper::setForThread(const sp<Looper>& looper) {
96 sp<Looper> old = getForThread(); // also has side-effect of initializing TLS
98 if (looper != NULL) {
99 looper->incStrong((void*)threadDestructor);
102 pthread_setspecific(gTLSKey, looper.get());
109 sp<Looper> Looper::getForThread() {
113 return (Looper*)pthread_getspecific(gTLSKey);
116 sp<Looper> Looper::prepare(int opts) {
118 sp<Looper> looper = Looper::getForThread();
119 if (looper == NULL) {
120 looper = new Looper(allowNonCallbacks);
121 Looper::setForThread(looper);
123 if (looper->getAllowNonCallbacks() != allowNonCallbacks) {
124 ALOGW("Looper already prepared for this thread with a different value for the "
127 return looper;
130 bool Looper::getAllowNonCallbacks() const {
134 void Looper::rebuildEpollLocked() {
168 void Looper::scheduleEpollRebuildLocked() {
178 int Looper::pollOnce(int timeoutMillis, int* outFd, int* outEvents, void** outData) {
214 int Looper::pollInner(int timeoutMillis) {
372 int Looper::pollAll(int timeoutMillis, int* outFd, int* outEvents, void** outData) {
398 void Looper::wake() {
413 void Looper::awoken() {
422 void Looper::pushResponse(int events, const Request& request) {
429 int Looper::addFd(int fd, int ident, int events, Looper_callbackFunc callback, void* data) {
433 int Looper::addFd(int fd, int ident, int events, const sp<LooperCallback>& callback, void* data) {
441 ALOGE("Invalid attempt to set NULL callback but not allowed for this looper.");
516 int Looper::removeFd(int fd) {
520 int Looper::removeFd(int fd, int seq) {
578 void Looper::sendMessage(const sp<MessageHandler>& handler, const Message& message) {
583 void Looper::sendMessageDelayed(nsecs_t uptimeDelay, const sp<MessageHandler>& handler,
589 void Looper::sendMessageAtTime(nsecs_t uptime, const sp<MessageHandler>& handler,
608 // Optimization: If the Looper is currently sending a message, then we can skip
609 // the call to wake() because the next thing the Looper will do after processing
611 // not even matter whether this code is running on the Looper thread.
623 void Looper::removeMessages(const sp<MessageHandler>& handler) {
640 void Looper::removeMessages(const sp<MessageHandler>& handler, int what) {
658 bool Looper::isPolling() const {
662 void Looper::Request::initEventItem(struct epoll_event* eventItem) const {