On Tuesday, January 31, 2012 6:35:08 am [email protected] wrote:
> Hello,
> Could someone please explain why mtx_trylock() must not be called on a spin 
> mutex?
> Is it conceptually wrong or is it a restriction of FreeBSD kernel 
> implementation?

The current mutex API generally uses different methods for the different types 
of
mutexes (at some point I may split spin locks out into a completely separate
API to simplify things).  If we wanted to do trylocks on spinlocks, then a new
mtx_trylock_spin() method would be added as you've done.  To date we haven't had
any use cases for trylock operations on a spin lock.  Even try locks on other
locking primitives are used fairly rarely.

-- 
John Baldwin
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[email protected]"

Reply via email to