@@ -110,6 +110,7 @@ static std::recursive_mutex *g_debugger_list_mutex_ptr =
110110static Debugger::DebuggerList *g_debugger_list_ptr =
111111 nullptr ; // NOTE: intentional leak to avoid issues with C++ destructor chain
112112static llvm::DefaultThreadPool *g_thread_pool = nullptr ;
113+ static llvm::DefaultThreadPool *g_symbol_thread_pool = nullptr ;
113114
114115static constexpr OptionEnumValueElement g_show_disassembly_enum_values[] = {
115116 {
@@ -715,6 +716,8 @@ void Debugger::Initialize(LoadPluginCallbackType load_plugin_callback) {
715716 g_debugger_list_mutex_ptr = new std::recursive_mutex ();
716717 g_debugger_list_ptr = new DebuggerList ();
717718 g_thread_pool = new llvm::DefaultThreadPool (llvm::optimal_concurrency ());
719+ g_symbol_thread_pool =
720+ new llvm::DefaultThreadPool (llvm::optimal_concurrency ());
718721 g_load_plugin_callback = load_plugin_callback;
719722}
720723
@@ -731,6 +734,13 @@ void Debugger::Terminate() {
731734 if (g_thread_pool) {
732735 // The destructor will wait for all the threads to complete.
733736 delete g_thread_pool;
737+ g_thread_pool = nullptr ;
738+ }
739+
740+ if (g_symbol_thread_pool) {
741+ // The destructor will wait for all the threads to complete.
742+ delete g_symbol_thread_pool;
743+ g_symbol_thread_pool = nullptr ;
734744 }
735745
736746 if (g_debugger_list_ptr && g_debugger_list_mutex_ptr) {
@@ -2383,3 +2393,9 @@ llvm::ThreadPoolInterface &Debugger::GetThreadPool() {
23832393 " Debugger::GetThreadPool called before Debugger::Initialize" );
23842394 return *g_thread_pool;
23852395}
2396+
2397+ llvm::ThreadPoolInterface &Debugger::GetSymbolThreadPool () {
2398+ assert (g_symbol_thread_pool &&
2399+ " Debugger::GetSymbolThreadPool called before Debugger::Initialize" );
2400+ return *g_symbol_thread_pool;
2401+ }
0 commit comments