Macros | |
#define | ein_no_thread_safety_analysis |
#define | ein_lockable |
#define | ein_scoped_lockable |
#define | ein_guarded_var |
#define | ein_pt_guarded_var |
#define | ein_guarded_by(x) |
#define | ein_pt_guarded_by(x) |
#define | ein_acquired_before(...) |
#define | ein_acquired_after(...) |
#define | ein_exclusive_lock_function(...) |
#define | ein_shared_trylock_function(...) |
#define | ein_unlock_function(...) |
#define | ein_lock_returned(__x) |
#define | ein_locks_excluded(...) |
#define | ein_exclusive_locks_required(...) |
#define | ein_shared_locks_required(...) |
these are supported by -Wthread-safety
#define ein_acquired_after | ( | ... | ) |
Use on a declaration of a lockable variable to specify that the lock must be acquired after all attribute arguments. Arguments must be lockable type, and there must be at least one argument.
Definition at line 146 of file thread_safety.hpp.
#define ein_acquired_before | ( | ... | ) |
Use on a declaration of a lockable variable to specify that the lock must be acquired before all attribute arguments. Arguments must be lockable type, and there must be at least one argument.
Definition at line 131 of file thread_safety.hpp.
#define ein_exclusive_lock_function | ( | ... | ) |
Use on a function declaration to specify that the function acquires all listed locks exclusively. This attribute takes zero or more arguments: either of lockable type or integers indexing into function parameters of lockable type. If no arguments are given, the acquired lock is implicitly that of the enclosing object.
Definition at line 163 of file thread_safety.hpp.
#define ein_exclusive_locks_required | ( | ... | ) |
Use on a function declaration to specify that the function must be called while holding the listed exclusive locks. Arguments must be lockable type, and there must be at least one argument.
Definition at line 242 of file thread_safety.hpp.
#define ein_guarded_by | ( | x | ) |
Use on a variable declaration to specify that the variable must be accessed while holding lock l
.
Definition at line 103 of file thread_safety.hpp.
#define ein_guarded_var |
Use on a variable declaration to specify that the variable must be accessed while holding some lock.
Definition at line 77 of file thread_safety.hpp.
#define ein_lock_returned | ( | __x | ) |
Use on a function declaration to specify that the function returns lock l
(l
must be of lockable type). This annotation is used to aid in resolving lock expressions.
Definition at line 214 of file thread_safety.hpp.
#define ein_lockable |
Use on a class definition to specify that it has a lockable type (e.g. a Mutex class). This annotation is primarily used to check consistency.
Definition at line 49 of file thread_safety.hpp.
#define ein_locks_excluded | ( | ... | ) |
Use on a function declaration to specify that the function must not be called with the listed locks. Arguments must be lockable type, and there must be at least one argument.
Definition at line 228 of file thread_safety.hpp.
#define ein_no_thread_safety_analysis |
Use on a function declaration to specify that the thread safety analysis should not be run on that function. This attribute provides an escape hatch (e.g. for situations when it is difficult to annotate the locking policy).
Definition at line 35 of file thread_safety.hpp.
#define ein_pt_guarded_by | ( | x | ) |
Use on a pointer declaration to specify that the pointer must be dereferenced while holding lock l
.
Definition at line 116 of file thread_safety.hpp.
#define ein_pt_guarded_var |
Use on a pointer declaration to specify that the pointer must be dereferenced while holding some lock.
Definition at line 90 of file thread_safety.hpp.
#define ein_scoped_lockable |
Use on a class definition to specify that it has a “scoped” lockable type. Objects of this type will acquire the lock upon construction and release it upon going out of scope. This annotation is primarily used to check consistency.
Definition at line 64 of file thread_safety.hpp.
#define ein_shared_locks_required | ( | ... | ) |
Use on a function declaration to specify that the function must be called while holding the listed shared locks. Arguments must be lockable type, and there must be at least one argument.
Definition at line 256 of file thread_safety.hpp.
#define ein_shared_trylock_function | ( | ... | ) |
Use on a function declaration to specify that the function will try (without blocking) to acquire all listed locks, although the locks may be shared (e.g. read locks). This attribute takes one or more arguments. The first argument is an integer or boolean value specifying the return value of a successful lock acquisition. The remaining arugments are either of lockable type or integers indexing into function parameters of lockable type. If only one argument is given, the acquired lock is implicitly this
of the enclosing object.
Definition at line 183 of file thread_safety.hpp.
#define ein_unlock_function | ( | ... | ) |
Use on a function declaration to specify that the function releases all listed locks. This attribute takes zero or more arguments: either of lockable type or integers indexing into function parameters of lockable type. If no arguments are given, the acquired lock is implicitly this
of the enclosing object.
Definition at line 199 of file thread_safety.hpp.