1 //===-- dd_rtl.h ----------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 #include "sanitizer_common/sanitizer_internal_defs.h"
13 #include "sanitizer_common/sanitizer_deadlock_detector_interface.h"
14 #include "sanitizer_common/sanitizer_flags.h"
15 #include "sanitizer_common/sanitizer_allocator_internal.h"
16 #include "sanitizer_common/sanitizer_addrhashmap.h"
17 #include "sanitizer_common/sanitizer_mutex.h"
21 typedef DDFlags Flags;
28 DDPhysicalThread *dd_pt;
29 DDLogicalThread *dd_lt;
31 bool ignore_interceptors;
34 struct Callback : DDCallback {
37 Callback(Thread *thr);
38 u32 Unwind() override;
41 typedef AddrHashMap<Mutex, 31051> MutexHashMap;
46 BlockingMutex report_mutex;
47 MutexHashMap mutex_map;
50 inline Flags* flags() {
56 void InitializeInterceptors();
58 void ThreadInit(Thread *thr);
59 void ThreadDestroy(Thread *thr);
61 void MutexBeforeLock(Thread *thr, uptr m, bool writelock);
62 void MutexAfterLock(Thread *thr, uptr m, bool writelock, bool trylock);
63 void MutexBeforeUnlock(Thread *thr, uptr m, bool writelock);
64 void MutexDestroy(Thread *thr, uptr m);