Displaying 2 results from an estimated 2 matches for "rw_lock_held".
2007 Nov 24
19
R/W lock portability issue
Hi,
I am having a problem porting Solaris R/W lock functionality to Linux.
The problem is that RW_LOCK_HELD() doesn''t have an equivalent function
in pthreads.
This was not a problem before because RW_LOCK_HELD() was only used in
ASSERT statements. In this case, I was able to make it work by making it
behave a bit differently (specifically, it would return true if *any*
thread was holding th...
2006 Jun 02
5
Read-write locks in libzpool
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 != curthread);
if (rw == RW_READER)
(void) rw_rdlock(&rwlp->rw_lock);
else
(void) rw_wrlock(&rwlp->rw_lock);
rwlp->rw_owner = curthread;
}
Doesn''t RW_LOCK_HELD() check if there''...