I would like to make a synchronized method, such that all objects from that type of thread class can only access this function one at a time.
When looking at this web page, it says that:
An object for which access is to be coordinated is accessed through the use of synchronized methods. These methods are declared with the synchronized keyword. Only one synchronized method can be invoked for an object at a given point in time. This keeps synchronized methods in multiple threads from conflicting with each other.
This not what I am looking for, as I said, because I want to be able to make calls on the class mutually exclusive.
To make a method synchronize on the class (instead of a specific instance of the class), write:
or