educative.io

Content wrong/misleading

The ownership of the monitor can be achieved in the following ways:

the method the thread is executing has synchronized in its signature

the thread is executing a block that is synchronized on the object on which wait or notify will be called

in case of a class, the thread is executing a static method which is synchronized.

===
I think point #1 and 3 are wrong. A synchronized method only provides mutual exclusion. It doesn’t provide monitor capabilities since there is no object associated with the method on which wait() or notify() can be called.


Course: Java Multithreading for Senior Engineering Interviews - Learn Interactively
Lesson: Java's Monitor & Hoare vs Mesa Monitors - Java Multithreading for Senior Engineering Interviews