lib/simplecov/result_merger.rb
# Ensure only one process is reading or writing the resultset at any
# given time
Ensure only one process is reading or writing the resultset at any
given time
Ensure only one process is reading or writing the resultset at any given time
def synchronize_resultset
        return yield if defined?(@resultset_locked) && @resultset_locked
        begin
          @resultset_locked = true
          File.open(resultset_writelock, "w+") do |f|
            f.flock(File::LOCK_EX)
            yield
          end
        ensure
          @resultset_locked = false
        end
      end
def synchronize_resultset return yield if defined? ( @resultset_locked ) && @resultset_locked begin @resultset_locked = true File . open ( resultset_writelock , "w+" ) do | f | f . flock ( File :: LOCK_EX ) yield end ensure @resultset_locked = false end end
Ensure only one process is reading or writing the resultset at any
given time
Ensure only one process is reading or writing the resultset at any given time
# make it reentrant