lkml.org 
[lkml]   [2010]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 07/12] rwsem: wake queued readers when writer blocks on active read lock
Date
Michel Lespinasse <walken@google.com> wrote:

> + /* if there are no active locks, wake the front queued process(es) up.
> + *
> + * or if we're called from a failed down_write(), and there were
> + * already threads queued before us, and there are no active writers,
> + * the lock must be read owned; try to wake any read locks that were
> + * queued ahead of us. */

That looks weird. Can I suggest rewriting it thus:

/* If there are no active locks, wake the front queued process(es) up.
*
* Alternatively, if we're called from a failed down_write(), there
* were already threads queued before us and there are no active
* writers, the lock must be read owned; so we try to wake any read
* locks that were queued ahead of us. */

David


\
 
 \ /
  Last update: 2010-05-12 14:37    [W:0.123 / U:26.316 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site