Ravi Murty wrote:
Hello All,

The implementation of critical_enter and critical_exit changed between
freebsd 5 and freebsd 6. In the newer implemtnation, the code checks if
td_critnest is 1 and if it is sets it to zero, then checks if the thread
owes a preempt. If so, it increments td_critnest by 1 before grabbing a lock
and then decrements it back to zero. I can't figure out why it does this.
The freebsd 5 implementation seems straightforward where we check if the
thread owes a preempt and if so we switch to the new thread. Can anyone help
me with this?

Thanks
Ravi

I guess this becauses thread_lock() also calls critical_exit(), this
code avoids recursion.


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

Reply via email to