This class could be very error prone because you do an operation while holding a lock on an object. 

Can you add more documentation why this class needs to be threadsafe at all?