Threads A, B, C in that order, reach synchronized method f() in a single object.
All have the same priority.
B and C are blocked.
A leaves f().
What thread now begins running in f()? Is it always B on the principle of FIFO? Or is the order undetermined?
If C has a higher priority than B, does that guarantee that C will run rather than B?
The order is undefined. Having a higher priority does not guarantee first resumption. The higher priority means a thread gets more CPU time while running, but an implementation is not required to give it the lock first.
Incidentally, there is no way to write deterministic code that guarantees the A-B-C lock-entry ordering you describe. It cannot be done with the Java methods. If you write code that you think produces that ordering reliably, you haven’t tested it enough. Since you cannot know in what order the threads will enter the lock, you also cannot know the order in which they’ll leave it – even if there were a FIFO policy.