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

//===-- tsan_rtl_mutex.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_deadlock_detector_interface.h>
#include <sanitizer_common/sanitizer_stackdepot.h>

#include "tsan_rtl.h"
#include "tsan_flags.h"
#include "tsan_sync.h"
#include "tsan_report.h"
#include "tsan_symbolize.h"
#include "tsan_platform.h"

namespace __tsan {

void ReportDeadlock(ThreadState *thr, uptr pc, DDReport *r);
void ReportDestroyLocked(ThreadState *thr, uptr pc, uptr addr,
                         FastState last_lock, StackID creation_stack_id);

struct Callback final : public DDCallback {};

void DDMutexInit(ThreadState *thr, uptr pc, SyncVar *s) {}

static void ReportMutexMisuse(ThreadState *thr, uptr pc, ReportType typ,
                              uptr addr, StackID creation_stack_id) {}

static void RecordMutexLock(ThreadState *thr, uptr pc, uptr addr,
                            StackID stack_id, bool write) {}

static void RecordMutexUnlock(ThreadState *thr, uptr addr) {}

void MutexCreate(ThreadState *thr, uptr pc, uptr addr, u32 flagz) {}

void MutexDestroy(ThreadState *thr, uptr pc, uptr addr, u32 flagz) {}

void MutexPreLock(ThreadState *thr, uptr pc, uptr addr, u32 flagz) {}

void MutexPostLock(ThreadState *thr, uptr pc, uptr addr, u32 flagz, int rec) {}

int MutexUnlock(ThreadState *thr, uptr pc, uptr addr, u32 flagz) {}

void MutexPreReadLock(ThreadState *thr, uptr pc, uptr addr, u32 flagz) {}

void MutexPostReadLock(ThreadState *thr, uptr pc, uptr addr, u32 flagz) {}

void MutexReadUnlock(ThreadState *thr, uptr pc, uptr addr) {}

void MutexReadOrWriteUnlock(ThreadState *thr, uptr pc, uptr addr) {}

void MutexRepair(ThreadState *thr, uptr pc, uptr addr) {}

void MutexInvalidAccess(ThreadState *thr, uptr pc, uptr addr) {}

void Acquire(ThreadState *thr, uptr pc, uptr addr) {}

void AcquireGlobal(ThreadState *thr) {}

void Release(ThreadState *thr, uptr pc, uptr addr) {}

void ReleaseStore(ThreadState *thr, uptr pc, uptr addr) {}

void ReleaseStoreAcquire(ThreadState *thr, uptr pc, uptr addr) {}

void IncrementEpoch(ThreadState *thr) {}

#if !SANITIZER_GO
void AfterSleep(ThreadState *thr, uptr pc) {}
#endif

void ReportDeadlock(ThreadState *thr, uptr pc, DDReport *r) {}

void ReportDestroyLocked(ThreadState *thr, uptr pc, uptr addr,
                         FastState last_lock, StackID creation_stack_id) {}

}  // namespace __tsan