mirror of
git://git.yoctoproject.org/meta-intel.git
synced 2025-07-19 21:09:03 +02:00

https://github.com/intel/opencl-clang/tree/ocl-open-100/patches Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
36 lines
1.2 KiB
Diff
36 lines
1.2 KiB
Diff
From cfb18b75e8a353bc7486f337541476a36994b063 Mon Sep 17 00:00:00 2001
|
|
From: juanrod2 <>
|
|
Date: Tue, 22 Dec 2020 08:33:08 +0800
|
|
Subject: [PATCH 3/7] Memory leak fix for Managed Static Mutex
|
|
|
|
Upstream-Status: Backport [Taken from opencl-clang patches; https://github.com/intel/opencl-clang/blob/ocl-open-100/patches/llvm/0001-Memory-leak-fix-for-Managed-Static-Mutex.patch]
|
|
|
|
Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
|
|
|
|
Cleaning a mutex inside ManagedStatic llvm class.
|
|
---
|
|
llvm/lib/Support/ManagedStatic.cpp | 6 +++++-
|
|
1 file changed, 5 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/llvm/lib/Support/ManagedStatic.cpp b/llvm/lib/Support/ManagedStatic.cpp
|
|
index 053493f72fb5..6571580ccecf 100644
|
|
--- a/llvm/lib/Support/ManagedStatic.cpp
|
|
+++ b/llvm/lib/Support/ManagedStatic.cpp
|
|
@@ -76,8 +76,12 @@ void ManagedStaticBase::destroy() const {
|
|
|
|
/// llvm_shutdown - Deallocate and destroy all ManagedStatic variables.
|
|
void llvm::llvm_shutdown() {
|
|
- std::lock_guard<std::recursive_mutex> Lock(*getManagedStaticMutex());
|
|
+ getManagedStaticMutex()->lock();
|
|
|
|
while (StaticList)
|
|
StaticList->destroy();
|
|
+
|
|
+ getManagedStaticMutex()->unlock();
|
|
+ delete ManagedStaticMutex;
|
|
+ ManagedStaticMutex = nullptr;
|
|
}
|
|
--
|
|
2.17.1
|
|
|