Class: RequireHooks::KernelPatch::Features::Locker::PathLock

Inherits:
Object
  • Object
show all
Defined in:
lib/require-hooks/mode/kernel_patch.rb

Instance Method Summary collapse

Constructor Details

#initializePathLock

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

Returns:

  • (Boolean)


77
78
79
# File 'lib/require-hooks/mode/kernel_patch.rb', line 77

def locked?
  @mu.locked?
end

#owned?Boolean

Returns:

  • (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

Returns:

  • (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