The only line that matters is that the specific mutex assigned is chosen randomly from 1 to n where n is the number of allowed processes..
No way 2 process out of ten won't end up sitting on the same mutex if n is 10. (well the first one runs, it doesn't sit). Code it any way you want, but a random number doesn't cut it.
but I understand your position.