On Wed, May 18, 2016 at 21:21:26 +0300, Sergey Fedorov wrote: > On 14/05/16 06:34, Emilio G. Cota wrote: > > +static inline int qemu_spin_trylock(QemuSpin *spin) > > +{ > > + if (atomic_test_and_set_acquire(&spin->value)) { > > + return -EBUSY; > > Seems this should be: > > return EBUSY;
I don't think any caller would/should ever check this value, other than if (!trylock). It's true though that pthread_mutex_trylock returns EBUSY, so it's probably best to remain consistent with it; I've made the change. Thanks, Emilio