qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v5 07/18] qemu-thread: add simple test-and-set s


From: Emilio G. Cota
Subject: Re: [Qemu-devel] [PATCH v5 07/18] qemu-thread: add simple test-and-set spinlock
Date: Wed, 18 May 2016 15:04:43 -0400
User-agent: Mutt/1.5.23 (2014-03-12)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]