File indexing completed on 2024-11-15 09:00:52
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #ifndef ABSL_BASE_INTERNAL_TSAN_MUTEX_INTERFACE_H_
0020 #define ABSL_BASE_INTERNAL_TSAN_MUTEX_INTERFACE_H_
0021
0022 #include "absl/base/config.h"
0023
0024
0025
0026
0027
0028
0029 #ifdef ABSL_INTERNAL_HAVE_TSAN_INTERFACE
0030 #error "ABSL_INTERNAL_HAVE_TSAN_INTERFACE cannot be directly set."
0031 #endif
0032
0033 #if defined(ABSL_HAVE_THREAD_SANITIZER) && defined(__has_include)
0034 #if __has_include(<sanitizer/tsan_interface.h>)
0035 #define ABSL_INTERNAL_HAVE_TSAN_INTERFACE 1
0036 #endif
0037 #endif
0038
0039 #ifdef ABSL_INTERNAL_HAVE_TSAN_INTERFACE
0040 #include <sanitizer/tsan_interface.h>
0041
0042 #define ABSL_TSAN_MUTEX_CREATE __tsan_mutex_create
0043 #define ABSL_TSAN_MUTEX_DESTROY __tsan_mutex_destroy
0044 #define ABSL_TSAN_MUTEX_PRE_LOCK __tsan_mutex_pre_lock
0045 #define ABSL_TSAN_MUTEX_POST_LOCK __tsan_mutex_post_lock
0046 #define ABSL_TSAN_MUTEX_PRE_UNLOCK __tsan_mutex_pre_unlock
0047 #define ABSL_TSAN_MUTEX_POST_UNLOCK __tsan_mutex_post_unlock
0048 #define ABSL_TSAN_MUTEX_PRE_SIGNAL __tsan_mutex_pre_signal
0049 #define ABSL_TSAN_MUTEX_POST_SIGNAL __tsan_mutex_post_signal
0050 #define ABSL_TSAN_MUTEX_PRE_DIVERT __tsan_mutex_pre_divert
0051 #define ABSL_TSAN_MUTEX_POST_DIVERT __tsan_mutex_post_divert
0052
0053 #else
0054
0055 #define ABSL_TSAN_MUTEX_CREATE(...)
0056 #define ABSL_TSAN_MUTEX_DESTROY(...)
0057 #define ABSL_TSAN_MUTEX_PRE_LOCK(...)
0058 #define ABSL_TSAN_MUTEX_POST_LOCK(...)
0059 #define ABSL_TSAN_MUTEX_PRE_UNLOCK(...)
0060 #define ABSL_TSAN_MUTEX_POST_UNLOCK(...)
0061 #define ABSL_TSAN_MUTEX_PRE_SIGNAL(...)
0062 #define ABSL_TSAN_MUTEX_POST_SIGNAL(...)
0063 #define ABSL_TSAN_MUTEX_PRE_DIVERT(...)
0064 #define ABSL_TSAN_MUTEX_POST_DIVERT(...)
0065
0066 #endif
0067
0068 #endif