> OVS_RELEASES applies to both read-locks and write-locks?
>
> I guess that an ordinary mutex is considered a write-lock?

Yep, I suppose we could create a second #define for that.  Not sure if
it matters or not.

> In lockfile.c, I guess that clang can only handle guarded-by on
> pointers?  Otherwise I don't see why one would introduce the new
> lock_table variable as a level of indirection.  Assuming that's true,
> can we declare lock_table as a const pointer, e.g.
>     static struct hmap *const lock_table OVS_GUARDED_BY(lock_table_mutex)
>         = &lock_table__;
> (That is, the pointer is const, not what it points to.)

Yes, this is fairly annoying.  Clang doesn't consider taking the
address of a variable as a read.  Technically they're right, but that
opens the door to all kinds of unsafety.  In my experience, this
change catches bugs, so I think it's worth the ugliness.
X-CudaMail-Whitelist-To: dev@openvswitch.org
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to