Method: Qonfig::DataSet::Lock#thread_safe_access

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

#thread_safe_access(&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



30
31
32
33
34
35
36
37
38
39
# File 'lib/qonfig/data_set/lock.rb', line 30

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