def sync_attr_sync(attribute, &block)
      mutex_var_name = "@sync_attr_#{attribute}".to_sym
      instance_variable_set(mutex_var_name, Mutex.new) unless instance_variable_defined?(mutex_var_name)
      instance_variable_get(mutex_var_name).synchronize(&block)
    end
def sync_attr_sync(attribute, &block)
      mutex_var_name = "@sync_attr_#{attribute}".to_sym
      instance_variable_set(mutex_var_name, Mutex.new) unless instance_variable_defined?(mutex_var_name)
      instance_variable_get(mutex_var_name).synchronize(&block)
    end
Thread safe way of creating the instance sync