We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 09f63ab + bafa348 commit 181dd79Copy full SHA for 181dd79
lldb/tools/driver/Driver.cpp
@@ -32,6 +32,7 @@
32
#include <bitset>
33
#include <clocale>
34
#include <csignal>
35
+#include <future>
36
#include <string>
37
#include <thread>
38
#include <utility>
@@ -821,6 +822,18 @@ int main(int argc, char const *argv[]) {
821
822
}
823
824
- SBDebugger::Terminate();
825
+ // When terminating the debugger we have to wait on all the background tasks
826
+ // to complete, which can take a while. Print a message when this takes longer
827
+ // than 1 second.
828
+ {
829
+ std::future<void> future =
830
+ std::async(std::launch::async, []() { SBDebugger::Terminate(); });
831
+
832
+ if (future.wait_for(std::chrono::seconds(1)) == std::future_status::timeout)
833
+ fprintf(stderr, "Waiting for background tasks to complete...\n");
834
835
+ future.wait();
836
+ }
837
838
return exit_code;
839
0 commit comments