Class RefCounter now uses an atomic counter value.