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.



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

Returns:

  • (Boolean)


72
73
74
# File 'lib/require-hooks/mode/kernel_patch.rb', line 72

def locked?
  @mu.locked?
end

#owned?Boolean

Returns:

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

Returns:

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