Loading...
Searching...
No Matches
35#include "pw_preprocessor/compiler.h"
57#if PW_HAVE_ATTRIBUTE(guarded_by)
58#define PW_GUARDED_BY(x) __attribute__((guarded_by(x)))
60#define PW_GUARDED_BY(x)
88#if PW_HAVE_ATTRIBUTE(pt_guarded_by)
89#define PW_PT_GUARDED_BY(x) __attribute__((pt_guarded_by(x)))
91#define PW_PT_GUARDED_BY(x)
112#if PW_HAVE_ATTRIBUTE(acquired_after)
113#define PW_ACQUIRED_AFTER(...) __attribute__((acquired_after(__VA_ARGS__)))
115#define PW_ACQUIRED_AFTER(...)
118#if PW_HAVE_ATTRIBUTE(acquired_before)
119#define PW_ACQUIRED_BEFORE(...) __attribute__((acquired_before(__VA_ARGS__)))
121#define PW_ACQUIRED_BEFORE(...)
150#if PW_HAVE_ATTRIBUTE(exclusive_locks_required)
151#define PW_EXCLUSIVE_LOCKS_REQUIRED(...) \
152 __attribute__((exclusive_locks_required(__VA_ARGS__)))
154#define PW_EXCLUSIVE_LOCKS_REQUIRED(...)
157#if PW_HAVE_ATTRIBUTE(shared_locks_required)
158#define PW_SHARED_LOCKS_REQUIRED(...) \
159 __attribute__((shared_locks_required(__VA_ARGS__)))
161#define PW_SHARED_LOCKS_REQUIRED(...)
183#if PW_HAVE_ATTRIBUTE(locks_excluded)
184#define PW_LOCKS_EXCLUDED(...) __attribute__((locks_excluded(__VA_ARGS__)))
186#define PW_LOCKS_EXCLUDED(...)
206#if PW_HAVE_ATTRIBUTE(lock_returned)
207#define PW_LOCK_RETURNED(x) __attribute__((lock_returned(x)))
209#define PW_LOCK_RETURNED(x)
217#if PW_HAVE_ATTRIBUTE(capability)
218#define PW_LOCKABLE(name) __attribute__((capability(name)))
219#elif PW_HAVE_ATTRIBUTE(lockable)
220#define PW_LOCKABLE(name) __attribute__((lockable))
222#define PW_LOCKABLE(name)
234#if PW_HAVE_ATTRIBUTE(scoped_lockable)
235#define PW_SCOPED_LOCKABLE __attribute__((scoped_lockable))
237#define PW_SCOPED_LOCKABLE
244#if PW_HAVE_ATTRIBUTE(exclusive_lock_function)
245#define PW_EXCLUSIVE_LOCK_FUNCTION(...) \
246 __attribute__((exclusive_lock_function(__VA_ARGS__)))
248#define PW_EXCLUSIVE_LOCK_FUNCTION(...)
255#if PW_HAVE_ATTRIBUTE(shared_lock_function)
256#define PW_SHARED_LOCK_FUNCTION(...) \
257 __attribute__((shared_lock_function(__VA_ARGS__)))
259#define PW_SHARED_LOCK_FUNCTION(...)
266#if PW_HAVE_ATTRIBUTE(unlock_function)
267#define PW_UNLOCK_FUNCTION(...) __attribute__((unlock_function(__VA_ARGS__)))
269#define PW_UNLOCK_FUNCTION(...)
281#if PW_HAVE_ATTRIBUTE(exclusive_trylock_function)
282#define PW_EXCLUSIVE_TRYLOCK_FUNCTION(...) \
283 __attribute__((exclusive_trylock_function(__VA_ARGS__)))
285#define PW_EXCLUSIVE_TRYLOCK_FUNCTION(...)
288#if PW_HAVE_ATTRIBUTE(shared_trylock_function)
289#define PW_SHARED_TRYLOCK_FUNCTION(...) \
290 __attribute__((shared_trylock_function(__VA_ARGS__)))
292#define PW_SHARED_TRYLOCK_FUNCTION(...)
300#if PW_HAVE_ATTRIBUTE(assert_exclusive_lock)
301#define PW_ASSERT_EXCLUSIVE_LOCK(...) \
302 __attribute__((assert_exclusive_lock(__VA_ARGS__)))
304#define PW_ASSERT_EXCLUSIVE_LOCK(...)
307#if PW_HAVE_ATTRIBUTE(assert_shared_lock)
308#define PW_ASSERT_SHARED_LOCK(...) \
309 __attribute__((assert_shared_lock(__VA_ARGS__)))
311#define PW_ASSERT_SHARED_LOCK(...)
319#if PW_HAVE_ATTRIBUTE(no_thread_safety_analysis)
320#define PW_NO_LOCK_SAFETY_ANALYSIS __attribute__((no_thread_safety_analysis))
322#define PW_NO_LOCK_SAFETY_ANALYSIS