Make Counter thread-safe.