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
No, synchronized will not do this. More specifically synchronized on the instance level will not do this. Instead you will have to synchronize on the class level.
For example instead of having:
public synchronized method()
{
//do stuff
}
You will have to code as:
public void method()
{
synchronized(this.getClass())
{
//do stuff
}
}