@repeat = opts[:repeat] if opts.include? :repeat
if block_given?
- @block = block
+ @block = block
elsif opts[:code]
@block = opts[:code]
end
end
def stop
- raise 'already stopped' unless @thread
+ unless @thread
+ warning 'trying to stop already stopped timer'
+ return
+ end
debug "stopping timer #{self}..."
@stopping = true
self.synchronize { @tick.signal }