[ovs-dev] [thread-safety 01/11] clang: Add annotations for thread safety check.

Ben Pfaff blp at nicira.com
Mon Jul 29 19:38:36 UTC 2013


On Mon, Jul 29, 2013 at 11:06:55AM -0700, Alex Wang wrote:
> > > +#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?

I understand now.  Yes, that would help a lot, thanks.



More information about the dev mailing list