Daniel Eischen <[EMAIL PROTECTED]> writes:
> I thought you wanted to know if it was locked regardless of who locked
> it.

Uh, no, that was not the intention.

> If you want to know if the current thread has it locked, it should be
> called pthread_mutex_isowned_np().

I don't see why one would be more correct than the other...

> I don't really see the utility in any other behavior, and almost
> question the need for _isowned.

It is extremely useful when debugging threaded code, as evidenced by the
numerous *_LOCKED macros that are used throughout the kernel.  Those
macros saved me a lot of time and aggravation when I made procfs and
linprocfs MPSAFE, for instance, and I am working on userland code at the
moment which would benefit greatly from the ability to assert that the
appropriate mutex is locked at the entry of a function that accesses or
modifies the corresponding data structure.

DES
-- 
Dag-Erling Smørgrav - [EMAIL PROTECTED]
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to