 |
Project
|
Loading...
Searching...
No Matches
Go to the documentation of this file.
11#ifndef O2_FRAMEWORK_THREADSAFETYANALYSIS_H_
12#define O2_FRAMEWORK_THREADSAFETYANALYSIS_H_
24#ifndef O2_DPL_THREAD_ANNOTATION_ATTRIBUTE__
25#if defined(__clang__) && (!defined(SWIG)) && defined(_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS)
26#define O2_DPL_THREAD_ANNOTATION_ATTRIBUTE__(x) __attribute__((x))
28#define O2_DPL_THREAD_ANNOTATION_ATTRIBUTE__(x)
31#define O2_DPL_CAPABILITY(x) \
32 O2_DPL_THREAD_ANNOTATION_ATTRIBUTE__(capability(x))
34#define O2_DPL_SCOPED_CAPABILITY \
35 O2_DPL_THREAD_ANNOTATION_ATTRIBUTE__(scoped_lockable)
37#define O2_DPL_GUARDED_BY(x) \
38 O2_DPL_THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x))
40#define O2_DPL_PT_GUARDED_BY(x) \
41 O2_DPL_THREAD_ANNOTATION_ATTRIBUTE__(pt_guarded_by(x))
43#define O2_DPL_ACQUIRED_BEFORE(...) \
44 O2_DPL_THREAD_ANNOTATION_ATTRIBUTE__(acquired_before(__VA_ARGS__))
46#define O2_DPL_ACQUIRED_AFTER(...) \
47 O2_DPL_THREAD_ANNOTATION_ATTRIBUTE__(acquired_after(__VA_ARGS__))
49#define O2_DPL_REQUIRES(...) \
50 O2_DPL_THREAD_ANNOTATION_ATTRIBUTE__(requires_capability(__VA_ARGS__))
52#define O2_DPL_REQUIRES_SHARED(...) \
53 O2_DPL_THREAD_ANNOTATION_ATTRIBUTE__(requires_shared_capability(__VA_ARGS__))
55#define O2_DPL_ACQUIRE(...) \
56 O2_DPL_THREAD_ANNOTATION_ATTRIBUTE__(acquire_capability(__VA_ARGS__))
58#define O2_DPL_ACQUIRE_SHARED(...) \
59 O2_DPL_THREAD_ANNOTATION_ATTRIBUTE__(acquire_shared_capability(__VA_ARGS__))
61#define O2_DPL_RELEASE(...) \
62 O2_DPL_THREAD_ANNOTATION_ATTRIBUTE__(release_capability(__VA_ARGS__))
64#define O2_DPL_RELEASE_SHARED(...) \
65 O2_DPL_THREAD_ANNOTATION_ATTRIBUTE__(release_shared_capability(__VA_ARGS__))
67#define O2_DPL_RELEASE_GENERIC(...) \
68 O2_DPL_THREAD_ANNOTATION_ATTRIBUTE__(release_generic_capability(__VA_ARGS__))
70#define O2_DPL_TRY_ACQUIRE(...) \
71 O2_DPL_THREAD_ANNOTATION_ATTRIBUTE__(try_acquire_capability(__VA_ARGS__))
73#define O2_DPL_TRY_ACQUIRE_SHARED(...) \
74 O2_DPL_THREAD_ANNOTATION_ATTRIBUTE__(try_acquire_shared_capability(__VA_ARGS__))
76#define O2_DPL_EXCLUDES(...) \
77 O2_DPL_THREAD_ANNOTATION_ATTRIBUTE__(locks_excluded(__VA_ARGS__))
79#define O2_DPL_ASSERT_CAPABILITY(x) \
80 O2_DPL_THREAD_ANNOTATION_ATTRIBUTE__(assert_capability(x))
82#define O2_DPL_ASSERT_SHARED_CAPABILITY(x) \
83 O2_DPL_THREAD_ANNOTATION_ATTRIBUTE__(assert_shared_capability(x))
85#define O2_DPL_RETURN_CAPABILITY(x) \
86 O2_DPL_THREAD_ANNOTATION_ATTRIBUTE__(lock_returned(x))
88#define O2_DPL_NO_THREAD_SAFETY_ANALYSIS \
89 O2_DPL_THREAD_ANNOTATION_ATTRIBUTE__(no_thread_safety_analysis)