From: Eric Liu Date: Wed, 12 Sep 2018 08:29:47 +0000 (+0000) Subject: [Tooling] Wait for all threads to finish before resetting CWD. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fc01a51bbef03747dab807b3613116495ce40cf5;p=clang [Tooling] Wait for all threads to finish before resetting CWD. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342028 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Tooling/AllTUsExecution.cpp b/lib/Tooling/AllTUsExecution.cpp index a7af541cc5..0f56bbf13f 100644 --- a/lib/Tooling/AllTUsExecution.cpp +++ b/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: "