File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 3333#define SHARED_LOCKS_REQUIRED (...) __attribute__((requires_shared_capability(__VA_ARGS__)))
3434#define NO_THREAD_SAFETY_ANALYSIS __attribute__ ((no_thread_safety_analysis))
3535#define ASSERT_EXCLUSIVE_LOCK (...) __attribute__((assert_capability(__VA_ARGS__)))
36+
37+ #if defined(__has_attribute)
38+ # if __has_attribute(resets_capability)
39+ # define HAS_RESET_CAPABILITY_ATTRIBUTE
40+ # endif
41+ #endif
42+
43+ #if defined HAS_RESET_CAPABILITY_ATTRIBUTE
44+ # define LOCKS_RESET (...) __attribute__((resets_capability(__VA_ARGS__)))
45+ # define RECURSIVE_LOCKS_REQUIRED (...) __attribute__((requires_capability(__VA_ARGS__)))
3646#else
47+ # define LOCKS_RESET (...)
48+ # define RECURSIVE_LOCKS_REQUIRED (...)
49+ #endif
50+
51+ #else // !__clang__
52+
3753#define LOCKABLE
3854#define SCOPED_LOCKABLE
3955#define GUARDED_BY (x )
5268#define SHARED_LOCKS_REQUIRED (...)
5369#define NO_THREAD_SAFETY_ANALYSIS
5470#define ASSERT_EXCLUSIVE_LOCK (...)
71+ #define LOCKS_RESET (...)
72+ #define RECURSIVE_LOCKS_REQUIRED (...)
5573#endif // __GNUC__
5674
5775// StdMutex provides an annotated version of std::mutex for us,
You can’t perform that action at this time.
0 commit comments