llvm/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cpp

//===-- tsan_rtl_thread.cpp -----------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file is a part of ThreadSanitizer (TSan), a race detector.
//
//===----------------------------------------------------------------------===//

#include "sanitizer_common/sanitizer_placement_new.h"
#include "tsan_rtl.h"
#include "tsan_mman.h"
#include "tsan_platform.h"
#include "tsan_report.h"
#include "tsan_sync.h"

namespace __tsan {

// ThreadContext implementation.

ThreadContext::ThreadContext(Tid tid) :{}

#if !SANITIZER_GO
ThreadContext::~ThreadContext() {}
#endif

void ThreadContext::OnReset() {}

#if !SANITIZER_GO
struct ThreadLeak {};

static void CollectThreadLeaks(ThreadContextBase *tctx_base, void *arg) {}
#endif

// Disabled on Mac because lldb test TestTsanBasic fails:
// https://reviews.llvm.org/D112603#3163158
#if !SANITIZER_GO && !SANITIZER_APPLE
static void ReportIgnoresEnabled(ThreadContext *tctx, IgnoreSet *set) {}

static void ThreadCheckIgnore(ThreadState *thr) {}
#else
static void ThreadCheckIgnore(ThreadState *thr) {}
#endif

void ThreadFinalize(ThreadState *thr) {}

int ThreadCount(ThreadState *thr) {}

struct OnCreatedArgs {};

Tid ThreadCreate(ThreadState *thr, uptr pc, uptr uid, bool detached) {}

void ThreadContext::OnCreated(void *arg) {}

extern "C" void __tsan_stack_initialization() {}

struct OnStartedArgs {};

void ThreadStart(ThreadState *thr, Tid tid, tid_t os_id,
                 ThreadType thread_type) {}

void ThreadContext::OnStarted(void *arg) {}

void ThreadFinish(ThreadState *thr) {}

void ThreadContext::OnFinished() {}

struct ConsumeThreadContext {};

Tid ThreadConsumeTid(ThreadState *thr, uptr pc, uptr uid) {}

struct JoinArg {};

void ThreadJoin(ThreadState *thr, uptr pc, Tid tid) {}

void ThreadContext::OnJoined(void *ptr) {}

void ThreadContext::OnDead() {}

void ThreadDetach(ThreadState *thr, uptr pc, Tid tid) {}

void ThreadContext::OnDetached(void *arg) {}

void ThreadNotJoined(ThreadState *thr, uptr pc, Tid tid, uptr uid) {}

void ThreadSetName(ThreadState *thr, const char *name) {}

#if !SANITIZER_GO
void FiberSwitchImpl(ThreadState *from, ThreadState *to) {}

ThreadState *FiberCreate(ThreadState *thr, uptr pc, unsigned flags) {}

void FiberDestroy(ThreadState *thr, uptr pc, ThreadState *fiber) {}

void FiberSwitch(ThreadState *thr, uptr pc,
                 ThreadState *fiber, unsigned flags) {}
#endif

}  // namespace __tsan