Class: RequireHooks::KernelPatch::Features::Locker::PathLock
- Inherits:
-
Object
- Object
- RequireHooks::KernelPatch::Features::Locker::PathLock
- Defined in:
- lib/require-hooks/mode/kernel_patch.rb
Instance Method Summary collapse
-
#initialize ⇒ PathLock
constructor
A new instance of PathLock.
- #lock! ⇒ Object
- #locked? ⇒ Boolean
- #owned? ⇒ Boolean
- #resolve! ⇒ Object
- #resolved? ⇒ Boolean
- #unlock! ⇒ Object
Constructor Details
#initialize ⇒ PathLock
Returns a new instance of PathLock.
68 69 70 71 |
# File 'lib/require-hooks/mode/kernel_patch.rb', line 68 def initialize @mu = Mutex.new @resolved = false end |
Instance Method Details
#lock! ⇒ Object
81 82 83 |
# File 'lib/require-hooks/mode/kernel_patch.rb', line 81 def lock! @mu.lock end |
#locked? ⇒ Boolean
77 78 79 |
# File 'lib/require-hooks/mode/kernel_patch.rb', line 77 def locked? @mu.locked? end |
#owned? ⇒ Boolean
73 74 75 |
# File 'lib/require-hooks/mode/kernel_patch.rb', line 73 def owned? @mu.owned? end |
#resolve! ⇒ Object
89 90 91 |
# File 'lib/require-hooks/mode/kernel_patch.rb', line 89 def resolve! @resolved = true end |
#resolved? ⇒ Boolean
93 94 95 |
# File 'lib/require-hooks/mode/kernel_patch.rb', line 93 def resolved? @resolved end |
#unlock! ⇒ Object
85 86 87 |
# File 'lib/require-hooks/mode/kernel_patch.rb', line 85 def unlock! @mu.unlock end |