#include "third_party/blink/renderer/platform/wtf/threading.h"
#include <atomic>
#include "build/build_config.h"
#include "third_party/blink/renderer/platform/wtf/stack_util.h"
#include "third_party/blink/renderer/platform/wtf/text/text_codec_icu.h"
namespace WTF {
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_WIN)
base::PlatformThreadId CurrentThread() { … }
#endif
#if DCHECK_IS_ON()
static std::atomic_bool g_thread_created(false);
bool IsBeforeThreadCreated() { … }
void WillCreateThread() { … }
void SetIsBeforeThreadCreatedForTest() { … }
#endif
ThreadSpecific<Threading>* Threading::static_data_;
Threading::Threading()
: … { … }
Threading::~Threading() = default;
void Threading::Initialize() { … }
#if BUILDFLAG(IS_WIN) && defined(COMPILER_MSVC)
size_t Threading::ThreadStackSize() {
if (!Threading::static_data_->IsSet())
return internal::ThreadStackSize();
Threading& data = WtfThreading();
if (!data.thread_stack_size_)
data.thread_stack_size_ = internal::ThreadStackSize();
return data.thread_stack_size_;
}
#endif
}