the lock should wrap all methods to ensure consistent views and behavior across threads