The Java documentation says that \"it is not possible for two invocations of synchronized methods on the same object to interleave\". What I need to know is whether synchro
If you make the method process static, it would only allow one invocation of the method at the same time.
process
If that is not possible, have a static variable, say Integer lock; And use synchronized (lock) inside your method process. that is
Integer lock
synchronized (lock)
process() { synchronized (lock) { // all your code } }