This question is inspired by this other question.
If multiple threads are waiting on a synchronized
block, and the lock becomes available, who goes first? Is it by thread priority (and then first-come-first-served)?
And do the same rules apply for notify
(with multiple wait
ing threads)?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…