[zfs-code] Read-write locks in libzpool

2006-06-02 Thread Ricardo Correia
On Friday 02 June 2006 05:12, Neil Perrin wrote: > I believe RW_LOCK_HELD checks it's not held by the calling thread only. > Note, a thread should not doubly read lock the same lock as > a write lock from another thread between the 2 would deadlock. Ok, that makes sense. Thanks :) I'm assuming RW

[zfs-code] Read-write locks in libzpool

2006-06-02 Thread Ricardo Correia
Hi, I think I found a bug in the rw_enter() implementation (emulation?) in libzpool, file /usr/src/lib/libzpool/common/kernel.c: void rw_enter(krwlock_t *rwlp, krw_t rw) { ASSERT(!RW_LOCK_HELD(rwlp)); ASSERT(rwlp->rw_owner != (void *)-1UL); ASSERT(rwlp->rw_owner != curthr