Improved locking for CsvInterface