> > +#if __has_feature(c_thread_safety_attributes)
> > +/* "clang" annotations for thread safety check.
> > + *
> > + * OVS_LOCKABLE indicates that the struct contains mutex element
> > + * which can be locked by ovs_mutex_lock().
> > + *
>
> What does the following sentence mean?  I do not understand it.  Also,
> s/sturct/struct/.
>

 Thanks Ben, for pointing my typo out.


>
> > + * MUTEX below can be more than one OVS_LOCKABLE sturcts.
> > + *
>

 This means that we can require a function to hold multiple locks while
 invoked.
 e.g. some_function() OVS_REQ_WRLOCK(wrlock_file1, wrlock_file2)

 Do you think adding the above sentences will make it more  comprehensible?

> + * In a global variable declaration:
> >   *
>
> Here, s/must be access/may only be accessed/:
>

  Thanks for pointing this out.


> > + * OVS_GUARDED_VAR indicates that the variable must be access while
> > + * some MUTEX is acquired.
> >   *
> > + * OVS_GUARDED_BY(...) indicates that the variable must be access while
> > + * MUTEX is acquired.
> > + *
> > + *
> > + * In a function prototype:
> > + *
> > + * OVS_ACQ_RDLOCK(...) and OVS_ACQ_WRLOCK(...) indicate that the
> > + * function must be called without MUTEX acquired and that it returns
> > + * with MUTEX acquired. OVS_RELEASES(...) indicates the reverse.
>
> OVS_RELEASES applies to both read-locks and write-locks?


  Yes,

I guess that an ordinary mutex is considered a write-lock?


  Yes,

  I'll wait for updates (as you suggested in comments) and rewrite this
part of  comments to make it more comprehensible.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to