Method: Milemarker#threadsafify!
- Defined in:
- lib/milemarker.rb
#threadsafify! ⇒ Milemarker
Turn ‘increment_and_batch` (and thus `increment_and_log_batch_line`) into a threadsafe version
72 73 74 75 76 77 78 |
# File 'lib/milemarker.rb', line 72 def threadsafify! @mutex = Mutex.new define_singleton_method(:increment_and_on_batch) do |&blk| threadsafe_increment_and_on_batch(&blk) end self end |