2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

compiler: Fix OVS_LOCKS_EXCLUDED on non clang compilers.

This patch renames OVS_LOCKS_EXCLUDED to simply OVS_EXCLUDED so it's
more consistent with the other thread safety annotations.  It also
adds it to the non-clang compilers.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
This commit is contained in:
Ethan Jackson
2013-07-31 10:49:34 -07:00
parent dd62b991ec
commit 5624b8ea01

View File

@@ -114,7 +114,7 @@
#define OVS_GUARDED __attribute__((guarded_var))
#define OVS_GUARDED_BY(...) __attribute__((guarded_by(__VA_ARGS__)))
#define OVS_RELEASES(...) __attribute__((unlock_function(__VA_ARGS__)))
#define OVS_LOCKS_EXCLUDED(...) __attribute__((locks_excluded(__VA_ARGS__)))
#define OVS_EXCLUDED(...) __attribute__((locks_excluded(__VA_ARGS__)))
#elif __CHECKER__
/* "sparse" annotations for mutexes and mutex-like constructs.
*
@@ -134,6 +134,7 @@
#define OVS_TRY_LOCK(REVAL, ...)
#define OVS_GUARDED
#define OVS_GUARDED_BY(...)
#define OVS_EXCLUDED(...)
#define OVS_RELEASES(...) __attribute__((context(MUTEX, 1, 0)))
#define OVS_MACRO_LOCK(...) __context__(MUTEX, 0, 1)
#define OVS_MACRO_RELEASE(...) __context__(MUTEX, 1, 0)
@@ -150,6 +151,7 @@
#define OVS_TRY_LOCK(...)
#define OVS_GUARDED
#define OVS_GUARDED_BY(...)
#define OVS_EXCLUDED(...)
#define OVS_RELEASES(...)
#define OVS_MACRO_LOCK(...)
#define OVS_MACRO_RELEASE(...)