Home | History | Annotate | Download | only in utils

Lines Matching defs:looper

4 // A looper implementation based on epoll().
6 #define LOG_TAG "Looper"
17 #include <utils/Looper.h>
37 Looper::Looper(bool allowNonCallbacks) :
100 Looper::~Looper() {
108 void Looper::initTLSKey() {
113 void Looper::threadDestructor(void *st) {
114 Looper* const self = static_cast<Looper*>(st);
120 void Looper::setForThread(const sp<Looper>& looper) {
121 sp<Looper> old = getForThread(); // also has side-effect of initializing TLS
123 if (looper != NULL) {
124 looper->incStrong((void*)threadDestructor);
127 pthread_setspecific(gTLSKey, looper.get());
134 sp<Looper> Looper::getForThread() {
138 return (Looper*)pthread_getspecific(gTLSKey);
141 sp<Looper> Looper::prepare(int opts) {
143 sp<Looper> looper = Looper::getForThread();
144 if (looper == NULL) {
145 looper = new Looper(allowNonCallbacks);
146 Looper::setForThread(looper);
148 if (looper->getAllowNonCallbacks() != allowNonCallbacks) {
149 LOGW("Looper already prepared for this thread with a different value for the "
152 return looper;
155 bool Looper::getAllowNonCallbacks() const {
159 int Looper::pollOnce(int timeoutMillis, int* outFd, int* outEvents, void** outData) {
192 int Looper::pollInner(int timeoutMillis) {
357 int Looper::pollAll(int timeoutMillis, int* outFd, int* outEvents, void** outData) {
384 void Looper::wake() {
408 void Looper::awoken() {
440 void Looper::pushResponse(int events, const Request& request) {
447 int Looper::addFd(int fd, int ident, int events, ALooper_callbackFunc callback, void* data) {
455 LOGE("Invalid attempt to set NULL callback but not allowed for this looper.");
531 int Looper::removeFd(int fd) {
568 ssize_t Looper::getRequestIndexLocked(int fd) {
580 void Looper::wakeAndLock() {