[ovs-dev] [netdev 11/27] netdev-vport: Use ovs_mutex rather than a raw pthread_mutex_t.

Andy Zhou azhou at nicira.com
Wed Aug 7 20:33:00 UTC 2013


Acked-by: Andy Zhou <azhou at nicira.com>



On Thu, Aug 1, 2013 at 2:29 PM, Ben Pfaff <blp at nicira.com> wrote:

> I'd forgotten even to use the xpthread variants here.
>
> Signed-off-by: Ben Pfaff <blp at nicira.com>
> ---
>  lib/netdev-vport.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c
> index 4214b38..14b3347 100644
> --- a/lib/netdev-vport.c
> +++ b/lib/netdev-vport.c
> @@ -413,17 +413,17 @@ set_tunnel_config(struct netdev *dev_, const struct
> smap *args)
>      }
>
>      if (tnl_cfg.ipsec) {
> -        static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
> +        static struct ovs_mutex mutex = OVS_MUTEX_INITIALIZER;
>          static pid_t pid = 0;
>
> -        pthread_mutex_lock(&mutex);
> +        ovs_mutex_lock(&mutex);
>          if (pid <= 0) {
>              char *file_name = xasprintf("%s/%s", ovs_rundir(),
>                                          "ovs-monitor-ipsec.pid");
>              pid = read_pidfile(file_name);
>              free(file_name);
>          }
> -        pthread_mutex_unlock(&mutex);
> +        ovs_mutex_unlock(&mutex);
>
>          if (pid < 0) {
>              VLOG_ERR("%s: IPsec requires the ovs-monitor-ipsec daemon",
> --
> 1.7.10.4
>
> _______________________________________________
> 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/20130807/b4a22b90/attachment-0003.html>


More information about the dev mailing list