Class: Qonfig::Settings::Lock Private

Inherits:
Object
  • Object
show all
Defined in:
lib/qonfig/settings/lock.rb

Overview

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

Since:

  • 0.2.0

Instance Method Summary collapse

Constructor Details

#initializeLock

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.

Returns a new instance of Lock.

Since:

  • 0.2.0



10
11
12
13
14
# File 'lib/qonfig/settings/lock.rb', line 10

def initialize
  @definition_lock = Mutex.new
  @access_lock = Mutex.new
  @merge_lock = Mutex.new
end

Instance Method Details

#thread_safe_access(&instructions) ⇒ Object

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.

Parameters:

  • instructions (Proc)

Returns:

  • (Object)

Since:

  • 0.2.0



30
31
32
# File 'lib/qonfig/settings/lock.rb', line 30

def thread_safe_access(&instructions)
  access_lock.synchronize(&instructions)
end

#thread_safe_definition(&instructions) ⇒ Object

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.

Parameters:

  • instructions (Proc)

Returns:

  • (Object)

Since:

  • 0.2.0



21
22
23
# File 'lib/qonfig/settings/lock.rb', line 21

def thread_safe_definition(&instructions)
  definition_lock.synchronize(&instructions)
end

#thread_safe_merge(&instructions) ⇒ Object

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.

Parameters:

  • instructions (Proc)

Returns:

  • (Object)

Since:

  • 0.2.0



39
40
41
# File 'lib/qonfig/settings/lock.rb', line 39

def thread_safe_merge(&instructions)
  merge_lock.synchronize(&instructions)
end