From fc01a51bbef03747dab807b3613116495ce40cf5 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Wed, 12 Sep 2018 08:29:47 +0000 Subject: [PATCH] [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 --- lib/Tooling/AllTUsExecution.cpp | 2 ++ 1 file changed, 2 insertions(+) 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: " -- 2.40.0