Improve a comment which, in the actual CVS stock, doesn't completely

explain the logic of the code chunk.
This commit is contained in:
attilio 2008-05-27 00:27:50 +00:00
parent 37ab20f934
commit e089ccfc1b

View File

@ -651,8 +651,11 @@ _rw_wlock_hard(struct rwlock *rw, uintptr_t tid, const char *file, int line)
}
#endif
/*
* If the lock was released while waiting for the turnstile
* chain lock retry.
* Check for the waiters flags about this rwlock.
* If the lock was released, without maintain any pending
* waiters queue, simply try to acquire it.
* If a pending waiters queue is present, claim the lock
* ownership and maintain the pending queue.
*/
x = v & (RW_LOCK_WAITERS | RW_LOCK_WRITE_SPINNER);
if ((v & ~x) == RW_UNLOCKED) {