[sheepdog] [PATCH 1/2] add helper macros to try lock and unlock based on urcu
Liu Yuan
namei.unix at gmail.com
Thu Nov 1 07:04:23 CET 2012
On 11/01/2012 01:59 PM, MORITA Kazutaka wrote:
> I guess lock/unlock semantics is more familiar with developers, but
> either is fine to me.
>
If lock/unlock is shoehorned into true/false condition, it looks very
hard to understand the code, at least to me.
> But note that we can't use bool variables anyway for uatomic_*
> functions because urcu complains the following warning.
>
> warning: cast from function call of type ‘long unsigned int’ to non-matching type ‘_B
I think the old convention to use int to indicate true or false is okay.
bool is rather new type. Anyway, it depends on the user to define the
type, and we can rely on gcc to warn out if not appropriate defined type.
Thanks,
Yuan
More information about the sheepdog
mailing list