lib/lsperfm/core/stats.rb
# below stats counter and output reader threads are sharing state using
# the @stats_lock mutex, @stats_count and @stats. this is a bit messy and should be
# refactored into a proper class eventually
below stats counter and output reader threads are sharing state using
the @stats_lock mutex, @stats_count and @stats. this is a bit messy and should be
refactored into a proper class eventually
below stats counter and output reader threads are sharing state using the @stats_lock mutex @stats_count and @stats . this is a bit messy and should be refactored into a proper class eventually
def detach_stats_counter
      Thread.new do
        loop do
          start = @stats_lock.synchronize{@stats_count}
          sleep(1)
          @stats_lock.synchronize{@stats << (@stats_count - start)}
        end
      end
    end
def detach_stats_counter Thread . new do loop do start = @stats_lock . synchronize { @stats_count } sleep ( 1 ) @stats_lock . synchronize { @stats << ( @stats_count - start ) } end end end
below stats counter and output reader threads are sharing state using
the @stats_lock mutex, @stats_count and @stats.
below stats counter and output reader threads are sharing state using the @stats_lock mutex @stats_count and @stats .