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.
63 64 65 66 |
# File 'lib/require-hooks/mode/kernel_patch.rb', line 63 def initialize @mu = Mutex.new @resolved = false end |
Instance Method Details
#lock! ⇒ Object
76 77 78 |
# File 'lib/require-hooks/mode/kernel_patch.rb', line 76 def lock! @mu.lock end |
#locked? ⇒ Boolean
72 73 74 |
# File 'lib/require-hooks/mode/kernel_patch.rb', line 72 def locked? @mu.locked? end |
#owned? ⇒ Boolean
68 69 70 |
# File 'lib/require-hooks/mode/kernel_patch.rb', line 68 def owned? @mu.owned? end |
#resolve! ⇒ Object
84 85 86 |
# File 'lib/require-hooks/mode/kernel_patch.rb', line 84 def resolve! @resolved = true end |
#resolved? ⇒ Boolean
88 89 90 |
# File 'lib/require-hooks/mode/kernel_patch.rb', line 88 def resolved? @resolved end |
#unlock! ⇒ Object
80 81 82 |
# File 'lib/require-hooks/mode/kernel_patch.rb', line 80 def unlock! @mu.unlock end |