I have seen usage of synchronized block by this so far but recently I learned that using dummy object is preferable. I found the following topic related to this.
Java sy
You are correct. In this case you need two different objects to synchronize on them separately.
For locking purpose the easiest way is to create Object objects.
Object
Object lock1 = new Object(); Object lock2 = new Object();