Class: Qonfig::Settings::Lock Private
- Inherits:
-
Object
- Object
- Qonfig::Settings::Lock
- 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.
Instance Method Summary collapse
-
#initialize ⇒ Lock
constructor
private
A new instance of Lock.
- #thread_safe_access(&instructions) ⇒ Object private
- #thread_safe_definition(&instructions) ⇒ Object private
- #thread_safe_merge(&instructions) ⇒ Object private
Constructor Details
#initialize ⇒ Lock
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.
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.
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.
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.
39 40 41 |
# File 'lib/qonfig/settings/lock.rb', line 39 def thread_safe_merge(&instructions) merge_lock.synchronize(&instructions) end |