Ingo Weinhold <ingo_weinhold@...> wrote:
> On 2008-07-07 at 20:45:14 [+0200], Axel Dörfler <axeld@...>
> > wrote:
> > does anyone mind if I change our rw_lock implementation to
> > something
> > BFS uses?
> > Unlike our current implementation, it allows to nest write locks
> > (and
> > read locks after you hold a write lock)? It would only need another
> > int32 for the owner count.
> That's OK. Just don't mess it up. ;-)
Oh, let me please :-)
> BTW, I intended to add a rw_lock_demote_to_read_lock() so that one
> seamlessly switch from a write lock to a read lock. I guess that's
> really required after your changes (since one could simply get an
> additional read lock and then drop the write lock), but in case you
> it, feel free to add it, too.
Currently, it would even be necessary, as the semantics are a bit
different; it doesn't differentiate between a read lock or a write lock
after the initial write lock. It would be pretty simple to change that,
though, if you want me to (I just didn't feel like changing the
fs_shell implementation as well...).