Fix bugs in spin_trylock_wr():
authorNicolas Thery <nth@dragonflybsd.org>
Wed, 4 Jun 2008 04:34:54 +0000 (04:34 +0000)
committerNicolas Thery <nth@dragonflybsd.org>
Wed, 4 Jun 2008 04:34:54 +0000 (04:34 +0000)
commit74af985ee0ab2383594c810f54fc07da4f1e1062
tree54569ba2328defbb6c6ecf52ef6350e65c5f5f67
parent51c3549213a21256bfe32c0ac3c29a62a372eac5
Fix bugs in spin_trylock_wr():

- globaldata.gd_spinlock_wr was not decremented back on failure;

- incorrect comparison in loop trying to clear cached shared bits (loop
  must fail if spinlock is still held for read by another cpu).

Reviewed-by: dillon@
sys/kern/kern_spinlock.c
sys/sys/spinlock2.h