• Home
  • Raw
  • Download

Lines Matching full:thread

31 // IMPORTANT: Instead of creating a base::Thread, consider using
34 // A simple thread abstraction that establishes a MessageLoop on a new thread.
35 // The consumer uses the MessageLoop of the thread to cause code to execute on
36 // the thread. When this object is destroyed the thread is terminated. All
37 // pending tasks queued on the thread's message loop will run to completion
38 // before the thread is terminated.
40 // WARNING! SUBCLASSES MUST CALL Stop() IN THEIR DESTRUCTORS! See ~Thread().
42 // After the thread is stopped, the destruction sequence is:
44 // (1) Thread::CleanUp()
48 // This API is not thread-safe: unless indicated otherwise its methods are only
53 // construction, Start(), task_runner()), but to then hand the Thread over to a
55 // case, Thread::DetachFromSequence() allows the owning sequence to give up
58 // Thread object (including ~Thread()).
59 class BASE_EXPORT Thread : PlatformThread::Delegate {
69 // Specifies the type of message loop that will be allocated on the thread.
73 // Specifies timer slack for thread message loop.
77 // on the thread. If message_pump_factory.is_null(), then a MessagePump
82 // Specifies the maximum stack size that the thread is allowed to use.
83 // This does not necessarily correspond to the thread's initial stack size.
87 // Specifies the initial thread priority.
90 // If false, the thread will not be joined on destruction. This is intended
100 // name is a display string to identify the thread.
101 explicit Thread(const std::string& name);
103 // Destroys the thread, stopping it if necessary.
105 // NOTE: ALL SUBCLASSES OF Thread MUST CALL Stop() IN THEIR DESTRUCTORS (or
108 // vtable, and the thread's ThreadMain calling the virtual method Run(). It
111 ~Thread() override;
114 // Causes the thread to initialize COM. This must be called before calling
115 // Start() or StartWithOptions(). If |use_mta| is false, the thread is also
125 // Starts the thread. Returns true if the thread was successfully started;
134 // Starts the thread. Behaves exactly like Start in addition to allow to
142 // Starts the thread and wait for the thread to start and run initialization
146 // jank on the calling thread, should be used only in testing code.
149 // Blocks until the thread starts running. Called within StartAndWait().
150 // Note that calling this causes jank on the calling thread, must be used
154 // Blocks until all tasks previously posted to this thread have been executed.
157 // Signals the thread to exit and returns once the thread has exited. The
158 // Thread object is completely reset and may be used as if it were newly
162 // Stop may be called multiple times and is simply ignored if the thread is
165 // Start/Stop are not thread-safe and callers that desire to invoke them from
168 // NOTE: If you are a consumer of Thread, it is not necessary to call this
169 // before deleting your Thread objects, as the destructor will do it.
170 // IF YOU ARE A SUBCLASS OF Thread, YOU MUST CALL THIS IN YOUR DESTRUCTOR.
173 // Signals the thread to exit in the near future.
178 // deadlock on Windows with printer worker thread. In any other case, Stop()
181 // Call Stop() to reset the thread object once it is known that the thread has
186 // (including ~Thread()) can happen from a different sequence (to which it
192 // Returns the message loop for this thread. Use the MessageLoop's
193 // PostTask methods to execute code on the thread. This only returns
198 // the Thread's Stop method instead.
200 // In addition to this Thread's owning sequence, this can also safely be
201 // called from the underlying thread itself.
204 // such only the owner should access it (and the underlying thread which in message_loop()
220 // Returns a TaskRunner for this thread. Use the TaskRunner's PostTask
221 // methods to execute code on the thread. Returns nullptr if the thread is not
223 // hold on to this even after the thread is gone; in this situation, attempts
226 // In addition to this Thread's owning sequence, this can also safely be
227 // called from the underlying thread itself.
236 // Returns the name of this thread (for display in debugger too).
239 // Returns the thread ID. Should not be called before the first Start*()
243 // WARNING: This function will block if the thread hasn't started yet.
245 // This method is thread-safe.
248 // Returns the current thread handle. If called before Start*() returns or
249 // after Stop() returns, an empty thread handle will be returned.
251 // This method is thread-safe.
257 // Returns true if the thread has been started, and not yet stopped.
273 // Bind this Thread to an existing MessageLoop instead of starting a new one.
298 // Whether this thread needs to initialize COM, and if so, in what mode.
302 // Mirrors the Options::joinable field used to start this thread. Verified
308 // Should be written on the thread that created this thread. Also read data
316 // The thread's handle.
320 // The thread's id once it has started.
325 // The thread's MessageLoop and RunLoop. Valid only while the thread is alive.
326 // Set by the created thread.
331 // in which case this Thread has no underlying |thread_| and should merely
338 // a thread.
341 // The name of the thread. Used for debugging purposes.
344 // Signaled when the created thread gets ready to use the message loop.
347 // This class is not thread-safe, use this to verify access from the owning
348 // sequence of the Thread.
351 DISALLOW_COPY_AND_ASSIGN(Thread);