• Home
  • Raw
  • Download

Lines Matching full:thread

5 #include "base/threading/thread.h"
25 // We use this thread-local variable to record whether or not a thread exited
28 // using a Thread to setup and run a MessageLoop.
37 Thread::SetThreadWasQuitProperly(true); in ThreadQuitHelper()
40 Thread::Options::Options() in Options()
47 Thread::Options::Options(MessageLoop::Type type, in Options()
55 Thread::Options::Options(const Options& other) = default;
57 Thread::Options::~Options() { in ~Options()
60 Thread::Thread(const std::string& name) in Thread() function in base::Thread
78 Thread::~Thread() { in ~Thread()
82 bool Thread::Start() { in Start()
91 bool Thread::StartWithOptions(const Options& options) { in StartWithOptions()
98 // Reset |id_| here to support restarting the thread. in StartWithOptions()
114 // Hold the thread_lock_ while starting a new thread, so that we can make sure in StartWithOptions()
115 // that thread_ is populated before the newly created thread accesses it. in StartWithOptions()
120 DLOG(ERROR) << "failed to create thread"; in StartWithOptions()
126 // The ownership of message_loop is managemed by the newly created thread in StartWithOptions()
134 bool Thread::StartAndWaitForTesting() { in StartAndWaitForTesting()
142 bool Thread::WaitUntilThreadStarted() const { in WaitUntilThreadStarted()
150 void Thread::Stop() { in Stop()
157 // Wait for the thread to exit. in Stop()
160 // the thread exits. Some consumers are abusing the API. Make them stop. in Stop()
165 // The thread should nullify message_loop_ on exit. in Stop()
171 void Thread::StopSoon() { in StopSoon()
172 // We should only be called on the same thread that started us. in StopSoon()
183 PlatformThreadId Thread::GetThreadId() const { in GetThreadId()
184 // If the thread is created but not started yet, wait for |id_| being ready. in GetThreadId()
190 bool Thread::IsRunning() const { in IsRunning()
191 // If the thread's already started (i.e. message_loop_ is non-null) and in IsRunning()
193 // true. (Note that stopping_ is touched only on the same thread that in IsRunning()
194 // starts / started the new thread so we need no locking here.) in IsRunning()
197 // Otherwise check the running_ flag, which is set to true by the new thread in IsRunning()
203 void Thread::Run(MessageLoop*) { in Run()
207 void Thread::SetThreadWasQuitProperly(bool flag) { in SetThreadWasQuitProperly()
211 bool Thread::GetThreadWasQuitProperly() { in GetThreadWasQuitProperly()
219 void Thread::ThreadMain() { in ThreadMain()
221 // any place in the following thread initialization code. in ThreadMain()
226 // Complete the initialization of our Thread object. in ThreadMain()
229 // Lazily initialize the message_loop so that it can run on this thread. in ThreadMain()
244 // Let the thread do extra initialization. in ThreadMain()
261 // Let the thread do extra cleanup. in ThreadMain()