This question is inspired by this other question.
If multiple threads are waiting on a synchronized block, and the lock becomes available, who goes firs
It depends on thread priority and thread scheduling algorithm and also the lock on the synchronized block is not "fair". This means that if there are 2 waiting threads with the same priority and the first thread waited more than the second thread that doesn't necessarily mean that the first thread will be executed first.