[ovs-dev] [PATCH] compiler: Fix OVS_LOCKS_EXCLUDED on non clang compilers.

Ben Pfaff blp at nicira.com
Wed Jul 31 17:52:53 UTC 2013


Looks good.
On Jul 31, 2013 10:51 AM, "Ethan Jackson" <ethan at nicira.com> wrote:

> 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 at nicira.com>
> ---
>  lib/compiler.h |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/lib/compiler.h b/lib/compiler.h
> index 1c01fd1..94a2218 100644
> --- a/lib/compiler.h
> +++ b/lib/compiler.h
> @@ -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(...)
> --
> 1.7.9.5
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20130731/10aadc57/attachment-0003.html>


More information about the dev mailing list