mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-17 18:58:39 +00:00
[FileCollector] Lock Mutex in copyFiles
We should synchronize reading of VFSWriter's data with the rest of the methods. Differential revision: https://reviews.llvm.org/D78956
This commit is contained in:
parent
6068fc0c0b
commit
a077fc20b4
@ -69,7 +69,7 @@ protected:
|
||||
addDirectoryImpl(const llvm::Twine &Dir,
|
||||
IntrusiveRefCntPtr<vfs::FileSystem> FS, std::error_code &EC);
|
||||
|
||||
/// Synchronizes adding files.
|
||||
/// Synchronizes access to Seen, VFSWriter and SymlinkMap.
|
||||
std::mutex Mutex;
|
||||
|
||||
/// The root directory where files are copied.
|
||||
|
@ -150,6 +150,8 @@ copyAccessAndModificationTime(StringRef Filename,
|
||||
}
|
||||
|
||||
std::error_code FileCollector::copyFiles(bool StopOnError) {
|
||||
std::lock_guard<std::mutex> lock(Mutex);
|
||||
|
||||
for (auto &entry : VFSWriter.getMappings()) {
|
||||
// Create directory tree.
|
||||
if (std::error_code EC =
|
||||
|
Loading…
x
Reference in New Issue
Block a user