But I think that it is not "fair" that at re-lock former
owner gets the lock immediately and the thread that waited on it for
longer time doesn't get a chance.

I believe this is what yield() is for. Before attempting a re-lock you should call yield() to allow other threads a chance to run.

(Side note: On FreeBSD, I believe only high priority threads will run when you yield(). As a workaround, I think you have to lower the thread's priority before yield() and then raise it again afterwards.)


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

Reply via email to