Replace synchronized with AtomicLong