Class: UniqueThread::Lock

Inherits:
Object
  • Object
show all
Defined in:
lib/unique_thread/locksmith.rb

Direct Known Subclasses

HeldLock

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(locked_until, stopwatch, locksmith) ⇒ Lock

Returns a new instance of Lock.



52
53
54
55
56
# File 'lib/unique_thread/locksmith.rb', line 52

def initialize(locked_until, stopwatch, locksmith)
  @locked_until = locked_until
  @stopwatch    = stopwatch
  @locksmith    = locksmith
end

Instance Attribute Details

#locked_untilObject (readonly)

Returns the value of attribute locked_until.



50
51
52
# File 'lib/unique_thread/locksmith.rb', line 50

def locked_until
  @locked_until
end

#locksmithObject (readonly)

Returns the value of attribute locksmith.



50
51
52
# File 'lib/unique_thread/locksmith.rb', line 50

def locksmith
  @locksmith
end

#stopwatchObject (readonly)

Returns the value of attribute stopwatch.



50
51
52
# File 'lib/unique_thread/locksmith.rb', line 50

def stopwatch
  @stopwatch
end

Instance Method Details

#acquired?Boolean

Returns:

  • (Boolean)


58
59
60
# File 'lib/unique_thread/locksmith.rb', line 58

def acquired?
  false
end

#while_heldObject



62
63
64
# File 'lib/unique_thread/locksmith.rb', line 62

def while_held
  nil
end