Our read/write lock implementation was not fair to writers. When
multiple IP forwarding threads were processing packets and holding
the shared net lock, the exclusive net lock was blocked permanently.
This could result in ping times well above 10 seconds.
Add the RWLOCK_WRWANT bit to the check mask of readers. Then they
cannot grab the lock if a writer is also waiting. This logic was
already present in revision 1.3, but got lost during refactoring.
When exiting the lock, there exists a race when the RWLOCK_WRWANT
bit gets deleted. Add a comment that was present until revision
1.8 to document it. The race itself is not easy to fix and had no
impact during testing.
OK sashan@