[llvm] 9c34a16 - [ThreadPool] delete debug global variable if not needed

Luboš Luňák via llvm-commits llvm-commits at lists.llvm.org
Tue May 3 23:13:08 PDT 2022


Author: Luboš Luňák
Date: 2022-05-04T08:12:45+02:00
New Revision: 9c34a16c7c52b2aad5bcb8d00500895968a7ac78

URL: https://github.com/llvm/llvm-project/commit/9c34a16c7c52b2aad5bcb8d00500895968a7ac78
DIFF: https://github.com/llvm/llvm-project/commit/9c34a16c7c52b2aad5bcb8d00500895968a7ac78.diff

LOG: [ThreadPool] delete debug global variable if not needed

https://lab.llvm.org/buildbot/#/builders/5/builds/23099

Added: 
    

Modified: 
    llvm/lib/Support/ThreadPool.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Support/ThreadPool.cpp b/llvm/lib/Support/ThreadPool.cpp
index bb566eb66121f..31461e31c65ce 100644
--- a/llvm/lib/Support/ThreadPool.cpp
+++ b/llvm/lib/Support/ThreadPool.cpp
@@ -100,6 +100,10 @@ void ThreadPool::processTasks(ThreadPoolTaskGroup *WaitingForGroup) {
 
 #ifndef NDEBUG
     CurrentThreadTaskGroups->pop_back();
+    if (CurrentThreadTaskGroups->empty()) {
+      delete CurrentThreadTaskGroups;
+      CurrentThreadTaskGroups = nullptr;
+    }
 #endif
 
     bool Notify;


        


More information about the llvm-commits mailing list