proxygen
SanitizeThread.h
Go to the documentation of this file.
1 /*
2  * Copyright 2013-present Facebook, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <folly/Portability.h>
20 
21 namespace folly {
22 
23 enum class annotate_rwlock_level : long {
24  rdlock = 0,
25  wrlock = 1,
26 };
27 
28 namespace detail {
29 
31  void const volatile* const addr,
32  char const* const f,
33  int const l);
34 
36  void const volatile* const addr,
37  char const* const f,
38  int const l);
39 
41  void const volatile* const addr,
42  char const* const f,
43  int const l);
44 
46  void const volatile* const addr,
47  annotate_rwlock_level const w,
48  char const* const f,
49  int const l);
50 
52  void const volatile* const addr,
53  annotate_rwlock_level const w,
54  char const* const f,
55  int const l);
56 
58  const volatile void* addr,
59  long size,
60  const char* desc,
61  const char* f,
62  int l);
63 
64 } // namespace detail
65 
67  void const volatile* const addr,
68  char const* const f,
69  int const l) {
70  if (kIsSanitizeThread) {
72  }
73 }
74 
76  void const volatile* const addr,
77  char const* const f,
78  int const l) {
79  if (kIsSanitizeThread) {
81  }
82 }
83 
85  void const volatile* const addr,
86  char const* const f,
87  int const l) {
88  if (kIsSanitizeThread) {
90  }
91 }
92 
94  void const volatile* const addr,
95  annotate_rwlock_level const w,
96  char const* const f,
97  int const l) {
98  if (kIsSanitizeThread) {
100  }
101 }
102 
104  void const volatile* const addr,
105  annotate_rwlock_level const w,
106  bool const result,
107  char const* const f,
108  int const l) {
109  if (result) {
110  annotate_rwlock_acquired(addr, w, f, l);
111  }
112 }
113 
115  void const volatile* const addr,
116  annotate_rwlock_level const w,
117  char const* const f,
118  int const l) {
119  if (kIsSanitizeThread) {
121  }
122 }
123 
125  void const volatile* const addr,
126  long const size,
127  char const* const desc,
128  char const* const f,
129  int const l) {
130  if (kIsSanitizeThread) {
131  detail::annotate_benign_race_sized_impl(addr, size, desc, f, l);
132  }
133 }
134 
135 } // namespace folly
void annotate_rwlock_released_impl(void const volatile *const addr, annotate_rwlock_level const w, char const *const f, int const l)
auto f
void annotate_rwlock_acquired_impl(void const volatile *const addr, annotate_rwlock_level const w, char const *const f, int const l)
#define FOLLY_ALWAYS_INLINE
Definition: CPortability.h:151
static FOLLY_ALWAYS_INLINE void annotate_rwlock_released(void const volatile *const addr, annotate_rwlock_level const w, char const *const f, int const l)
constexpr bool kIsSanitizeThread
Definition: Portability.h:124
static FOLLY_ALWAYS_INLINE void annotate_rwlock_destroy(void const volatile *const addr, char const *const f, int const l)
void annotate_benign_race_sized_impl(const volatile void *addr, long size, const char *desc, const char *f, int l)
void annotate_rwlock_destroy_impl(void const volatile *const addr, char const *const f, int const l)
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
static FOLLY_ALWAYS_INLINE void annotate_benign_race_sized(void const volatile *const addr, long const size, char const *const desc, char const *const f, int const l)
void annotate_rwlock_create_impl(void const volatile *const addr, char const *const f, int const l)
constexpr auto size(C const &c) -> decltype(c.size())
Definition: Access.h:45
static FOLLY_ALWAYS_INLINE void annotate_rwlock_try_acquired(void const volatile *const addr, annotate_rwlock_level const w, bool const result, char const *const f, int const l)
static FOLLY_ALWAYS_INLINE void annotate_rwlock_create_static(void const volatile *const addr, char const *const f, int const l)
void annotate_rwlock_create_static_impl(void const volatile *const addr, char const *const f, int const l)
static FOLLY_ALWAYS_INLINE void annotate_rwlock_acquired(void const volatile *const addr, annotate_rwlock_level const w, char const *const f, int const l)
ThreadPoolListHook * addr
annotate_rwlock_level
static FOLLY_ALWAYS_INLINE void annotate_rwlock_create(void const volatile *const addr, char const *const f, int const l)