On 10/22/18 12:20 PM, Konstantin Belousov wrote:
Then why do you need to re-acquire the mutex after uiomove ?

Hi,

Because the code is factored this way:

mtx_lock();
while (uio->uio_resid > 0) {
        do state checks()
        mtx_unlock();
        retval = uiomove();
        mtx_lock();
}
mtx_unlock();

Yes, you're right the last mtx_lock() can be optimised away. I'm leaving that to somebody else. This code typically is processing MIDI events at very slow rates like 8KBytes/s and does not need to be very fast.

--HPS
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to