On 11/01/2012 01:07 PM, MORITA Kazutaka wrote: > +/* return true if the lock was acquired */ > +#define uatomic_trylock(lock) (uatomic_cmpxchg((lock), 0, 1) == 0) > +#define uatomic_is_locked(lock) (uatomic_read(lock) == 1) > +#define uatomic_unlock(lock) uatomic_set((lock), 0) > + I think uatomic locker candy is useful for complex uatomic_cmpxchg() operation, but not so for true/false condition. How about add another candy for true/false condition like, uatomic_set_{true,false}, uatomic_is_true candy helpers? Thanks, Yuan |