Method: Qonfig::DataSet::Lock#thread_safe_definition

Defined in:
lib/qonfig/data_set/lock.rb

#thread_safe_definition(&instructions) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:

  • instructions (Block)

Since:

  • 0.13.0



46
47
48
49
50
51
52
53
54
55
# File 'lib/qonfig/data_set/lock.rb', line 46

def thread_safe_definition(&instructions)
  if arbitary_lock.locked?
    # :nocov:
    # NOTE: covered in thread-based specs but simplecov can't gather this fact
    with_arbitary_access { acquire_definition_lock(&instructions) }
    # :nocov:
  else
    acquire_definition_lock(&instructions)
  end
end