• Home
  • Raw
  • Download

Lines Matching full:thread

32 // IMPORTANT: Instead of creating a base::Thread, consider using
35 // A simple thread abstraction that establishes a MessageLoop on a new thread.
36 // The consumer uses the MessageLoop of the thread to cause code to execute on
37 // the thread. When this object is destroyed the thread is terminated. All
38 // pending tasks queued on the thread's message loop will run to completion
39 // before the thread is terminated.
41 // WARNING! SUBCLASSES MUST CALL Stop() IN THEIR DESTRUCTORS! See ~Thread().
43 // After the thread is stopped, the destruction sequence is:
45 // (1) Thread::CleanUp()
49 // This API is not thread-safe: unless indicated otherwise its methods are only
54 // construction, Start(), task_runner()), but to then hand the Thread over to a
56 // case, Thread::DetachFromSequence() allows the owning sequence to give up
59 // Thread object (including ~Thread()).
60 class BASE_EXPORT Thread : PlatformThread::Delegate {
69 // thread. The underlying MessagePump will have its |timer_slack| set to the
85 // Specifies the type of message pump that will be allocated on the thread.
89 // An unbound Delegate that will be bound to the thread. Ownership
90 // of |delegate| will be transferred to the thread.
93 // Specifies timer slack for thread message loop.
97 // on the thread. If message_pump_factory.is_null(), then a MessagePump
103 // Specifies the maximum stack size that the thread is allowed to use.
104 // This does not necessarily correspond to the thread's initial stack size.
108 // Specifies the initial thread type.
111 // If false, the thread will not be joined on destruction. This is intended
128 // name is a display string to identify the thread.
129 explicit Thread(const std::string& name);
131 Thread(const Thread&) = delete;
132 Thread& operator=(const Thread&) = delete;
134 // Destroys the thread, stopping it if necessary.
136 // NOTE: ALL SUBCLASSES OF Thread MUST CALL Stop() IN THEIR DESTRUCTORS (or
139 // vtable, and the thread's ThreadMain calling the virtual method Run(). It
142 ~Thread() override;
145 // Causes the thread to initialize COM. This must be called before calling
146 // Start() or StartWithOptions(). If |use_mta| is false, the thread is also
156 // Starts the thread. Returns true if the thread was successfully started;
165 // Starts the thread. Behaves exactly like Start in addition to allow to
173 // Starts the thread and wait for the thread to start and run initialization
177 // jank on the calling thread, should be used only in testing code.
180 // Blocks until the thread starts running. Called within StartAndWait().
181 // Note that calling this causes jank on the calling thread, must be used
185 // Blocks until all tasks previously posted to this thread have been executed.
188 // Signals the thread to exit and returns once the thread has exited. The
189 // Thread object is completely reset and may be used as if it were newly
193 // Stop may be called multiple times and is simply ignored if the thread is
196 // Start/Stop are not thread-safe and callers that desire to invoke them from
199 // NOTE: If you are a consumer of Thread, it is not necessary to call this
200 // before deleting your Thread objects, as the destructor will do it.
201 // IF YOU ARE A SUBCLASS OF Thread, YOU MUST CALL THIS IN YOUR DESTRUCTOR.
204 // Signals the thread to exit in the near future.
209 // deadlock on Windows with printer worker thread. In any other case, Stop()
212 // Call Stop() to reset the thread object once it is known that the thread has
217 // (including ~Thread()) can happen from a different sequence (to which it
223 // Returns a TaskRunner for this thread. Use the TaskRunner's PostTask
224 // methods to execute code on the thread. Returns nullptr if the thread is not
226 // hold on to this even after the thread is gone; in this situation, attempts
229 // In addition to this Thread's owning sequence, this can also safely be
230 // called from the underlying thread itself.
233 // and as such only the owner should access it (and the underlying thread in task_runner()
248 // Returns the name of this thread (for display in debugger too).
251 // Returns the thread ID. Should not be called before the first Start*()
255 // WARNING: This function will block if the thread hasn't started yet.
257 // This method is thread-safe.
260 // Returns true if the thread has been started, and not yet stopped.
295 // Whether this thread needs to initialize COM, and if so, in what mode.
299 // Mirrors the Options::joinable field used to start this thread. Verified
305 // Should be written on the thread that created this thread. Also read data
313 // The thread's handle.
317 // The thread's id once it has started.
322 // The thread's Delegate and RunLoop are valid only while the thread is
323 // alive. Set by the created thread.
330 // a thread.
333 // The name of the thread. Used for debugging purposes.
336 // Signaled when the created thread gets ready to use the message loop.
339 // This class is not thread-safe, use this to verify access from the owning
340 // sequence of the Thread.