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.
That is exactly the point of lock objects - you can use different locks for different operations. Assuming it makes sense to run addA and addB concurrently (and from the looks of it - it definitely does), you should indeed have two separate locks, one for each method.