svn commit: r195918 - head/sys/netinet

Pawel Jakub Dawidek pjd at
Wed Jul 29 05:30:39 UTC 2009

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             
pjd at                 
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url :

More information about the svn-src-head mailing list