#include "base/threading/thread.h"
#include <memory>
#include <type_traits>
#include <utility>
#include "base/dcheck_is_on.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/memory/scoped_refptr.h"
#include "base/message_loop/message_pump.h"
#include "base/run_loop.h"
#include "base/synchronization/waitable_event.h"
#include "base/task/current_thread.h"
#include "base/task/sequence_manager/sequence_manager_impl.h"
#include "base/task/sequence_manager/task_queue.h"
#include "base/task/single_thread_task_runner.h"
#include "base/threading/thread_id_name_manager.h"
#include "base/threading/thread_restrictions.h"
#include "base/types/pass_key.h"
#include "build/build_config.h"
#include "third_party/abseil-cpp/absl/base/attributes.h"
#include "third_party/abseil-cpp/absl/base/dynamic_annotations.h"
#if (BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_NACL)) || BUILDFLAG(IS_FUCHSIA)
#include <optional>
#include "base/files/file_descriptor_watcher_posix.h"
#endif
#if BUILDFLAG(IS_WIN)
#include "base/win/scoped_com_initializer.h"
#endif
namespace base {
#if DCHECK_IS_ON()
namespace {
ABSL_CONST_INIT thread_local bool was_quit_properly = …;
}
#endif
namespace internal {
class SequenceManagerThreadDelegate : public Thread::Delegate { … };
}
Thread::Options::Options() = default;
Thread::Options::Options(MessagePumpType type, size_t size)
: … { … }
Thread::Options::Options(ThreadType thread_type) : … { … }
Thread::Options::Options(Options&& other)
: … { … }
Thread::Options& Thread::Options::operator=(Thread::Options&& other) { … }
Thread::Options::~Options() = default;
Thread::Thread(const std::string& name)
: … { … }
Thread::~Thread() { … }
bool Thread::Start() { … }
bool Thread::StartWithOptions(Options options) { … }
bool Thread::StartAndWaitForTesting() { … }
bool Thread::WaitUntilThreadStarted() const { … }
void Thread::FlushForTesting() { … }
void Thread::Stop() { … }
void Thread::StopSoon() { … }
void Thread::DetachFromSequence() { … }
PlatformThreadId Thread::GetThreadId() const { … }
bool Thread::IsRunning() const { … }
void Thread::Run(RunLoop* run_loop) { … }
void Thread::SetThreadWasQuitProperly(bool flag) { … }
bool Thread::GetThreadWasQuitProperly() { … }
void Thread::ThreadMain() { … }
void Thread::ThreadQuitHelper() { … }
}