On 29/04/2016 08:26, Fam Zheng wrote:
> > + if (to_wake) {
> > + Coroutine *co = to_wake->co;
> > + qemu_coroutine_wake(co->ctx, co);
> > + goto out;
> > + }
> > +
> > + /* Some concurrent lock() is in progress (we know this because of
> > + * count) but it hasn't yet put itself on the wait queue.
>
> Unlike OSv's lfmutex.cc, we don't seem to have count. Should the comment say
> "locked" instead?
Yes; we know at least one lock() is in progress because we found
mutex->locked > 1. locked cannot decrease until unlock() wakes up
someone or until a concurrent lock() completes a handoff---which must be
after unlock() writes a nonzero value tomutex->handoff
Paolo