native 0.0.1
Vectors, masks and wide register packs for C++26
Loading...
Searching...
No Matches
Thread Safety

these are supported by -Wthread-safety More...

Collaboration diagram for Thread Safety:

Macros

#define native_no_thread_safety_analysis
#define native_lockable
#define native_scoped_lockable
#define native_guarded_var
#define native_pt_guarded_var
#define native_guarded_by(x)
#define native_pt_guarded_by(x)
#define native_acquired_before(...)
#define native_acquired_after(...)
#define native_exclusive_lock_function(...)
#define native_shared_trylock_function(...)
#define native_unlock_function(...)
#define native_lock_returned(__x)
#define native_locks_excluded(...)
#define native_exclusive_locks_required(...)
#define native_shared_locks_required(...)

Detailed Description

these are supported by -Wthread-safety

Macro Definition Documentation

◆ native_acquired_after

#define native_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 778 of file attributes.h.

◆ native_acquired_before

#define native_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 763 of file attributes.h.

◆ native_exclusive_lock_function

#define native_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 795 of file attributes.h.

◆ native_exclusive_locks_required

#define native_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 874 of file attributes.h.

◆ native_guarded_by

#define native_guarded_by ( x)

Use on a variable declaration to specify that the variable must be accessed while holding lock l.

Definition at line 735 of file attributes.h.

◆ native_guarded_var

#define native_guarded_var

Use on a variable declaration to specify that the variable must be accessed while holding some lock.

Definition at line 709 of file attributes.h.

◆ native_lock_returned

#define native_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 846 of file attributes.h.

◆ native_lockable

#define native_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 681 of file attributes.h.

◆ native_locks_excluded

#define native_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 860 of file attributes.h.

◆ native_no_thread_safety_analysis

#define native_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 667 of file attributes.h.

◆ native_pt_guarded_by

#define native_pt_guarded_by ( x)

Use on a pointer declaration to specify that the pointer must be dereferenced while holding lock l.

Definition at line 748 of file attributes.h.

◆ native_pt_guarded_var

#define native_pt_guarded_var

Use on a pointer declaration to specify that the pointer must be dereferenced while holding some lock.

Definition at line 722 of file attributes.h.

◆ native_scoped_lockable

#define native_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 696 of file attributes.h.

◆ native_shared_locks_required

#define native_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 888 of file attributes.h.

◆ native_shared_trylock_function

#define native_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 815 of file attributes.h.

◆ native_unlock_function

#define native_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 831 of file attributes.h.