Here we have to use read lock to prevent ArgumentOutOfRangeException in a for loop (it could happen during ApplyLogsToDataFile)
We can't dispose journals before waiting for a flushing task