From 6857692687979d934e188d117eadc93f48d52a0c Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Wed, 12 Sep 2018 08:29:47 +0000 Subject: [Tooling] Wait for all threads to finish before resetting CWD. llvm-svn: 342028 --- clang/lib/Tooling/AllTUsExecution.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/Tooling/AllTUsExecution.cpp') diff --git a/clang/lib/Tooling/AllTUsExecution.cpp b/clang/lib/Tooling/AllTUsExecution.cpp index a7af541cc5d..0f56bbf13f7 100644 --- a/clang/lib/Tooling/AllTUsExecution.cpp +++ b/clang/lib/Tooling/AllTUsExecution.cpp @@ -129,6 +129,8 @@ llvm::Error AllTUsToolExecutor::execute( }, File); } + // Make sure all tasks have finished before resetting the working directory. + Pool.wait(); if (!InitialWorkingDir.empty()) { if (auto EC = llvm::sys::fs::set_current_path(InitialWorkingDir)) llvm::errs() << "Error while restoring working directory: " -- cgit v1.2.3