Home | History | Annotate | Download | only in libutils

Lines Matching defs:Thread

21 #include <utils/Thread.h>
49 * Thread wrappers
60 * Create and run a new thread.
152 pthread_t thread;
153 int result = pthread_create(&thread, &attr,
167 *threadId = (android_thread_id_t)thread; // XXX: this is not portable
173 static pthread_t android_thread_id_t_to_pthread(android_thread_id_t thread)
175 return (pthread_t) thread;
206 ALOG(LOG_VERBOSE, "thread", "thread exiting\n");
211 * Create and run a new thread.
233 ALOG(LOG_WARN, "thread", "WARNING: thread create failed\n");
388 ALOG(LOG_WARN, "thread", "WARNING: bad result from unlocking mutex\n");
397 ALOG(LOG_WARN, "thread", "WARNING: bad result from try-locking mutex\n");
438 // An auto-reset event used by the broadcast/signal thread to wait
439 // for all the waiting thread(s) to wake up and be released from
489 // If we're the last waiter thread during this particular broadcast
496 // any thread has a chance to run. Without it, another thread
565 * Signal the condition variable, allowing one thread to continue.
638 * This is our thread object!
641 Thread::Thread(bool canCallJava)
644 mLock("Thread::mLock"),
653 Thread::~Thread()
657 status_t Thread::readyToRun()
662 status_t Thread::run(const char* name, int32_t priority, size_t stack)
664 LOG_ALWAYS_FATAL_IF(name == nullptr, "thread name not provided to Thread::run");
669 // thread already started
702 // Do not refer to mStatus here: The thread is already running (may, in fact
704 // here merely indicates successfully starting the thread and does not
708 // Exiting scope of mLock is a memory barrier and allows new thread to run
711 int Thread::_threadLoop(void* user)
713 Thread* const self = static_cast<Thread*>(user);
715 sp<Thread> strong(self->mHoldSelf);
716 wp<Thread> weak(strong);
736 // (unless, of course, the thread has already been asked to exit
741 // the thread and the thread would simply disappear after the
756 // clear thread ID so that requestExitAndWait() does not exit if
757 // called by a new thread using the same thread ID as this one.
766 // Release our strong reference, to let a chance to the thread
776 void Thread::requestExit()
782 status_t Thread::requestExitAndWait()
787 "Thread (this=%p): don't call waitForExit() from this "
788 "Thread object's thread. It's a guaranteed deadlock!",
806 status_t Thread::join()
811 "Thread (this=%p): don't call join() from this "
812 "Thread object's thread. It's a guaranteed deadlock!",
825 bool Thread::isRunning() const {
831 pid_t Thread::getTid() const
840 ALOGW("Thread (this=%p): getTid() is undefined before run()", this);
847 bool Thread::exitPending() const