On Wed, Jul 29, 2009 at 01:23:24AM -0400, Randall Stewart wrote: > >Instead of using additional argument to the sctp_add_to_readq() > >function, wouldn't it be sufficient to just check with mtx_owned(9) if > >the lock is already held? > > Hmm... I suppose one could go that way... but traditionally upper code > as > told the lower code that it holds/does not hold the lock. This is true > in quite a few other functions...
We can find examples of both behaviours in many places, that's true. The reason to keep additional argument is that once you decide to move to read-write locks it might not be reliable to check if read-lock is already held by the current thread. All in all both solutions work, my observation was only that diff could be significantly reduced by using mtx_owned(9), nothing major. -- Pawel Jakub Dawidek http://www.wheel.pl p...@freebsd.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am!
pgpY6p7CIVXcQ.pgp
Description: PGP signature