d3d11: avoid exit-time-destructor warning

Applies to use_custom_libcxx=false on Windows builds. On MSVC's C++
runtime, std::mutex has a destructor.

Bug: angleproject:8327
Change-Id: I6118753569ce0529015e82673571c961a38f30e6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4819793
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Auto-Submit: Steven Noonan <steven@uplinklabs.net>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
This commit is contained in:
Steven Noonan
2023-08-28 17:45:00 -07:00
committed by Angle LUCI CQ
parent aed8ec2a8a
commit 0b20cd6a86

View File

@@ -1035,10 +1035,10 @@ egl::Error Renderer11::initializeD3DDevice()
void Renderer11::setGlobalDebugAnnotator()
{
static std::mutex gMutex;
static angle::base::NoDestructor<std::mutex> gMutex;
static angle::base::NoDestructor<DebugAnnotator11> gGlobalAnnotator;
std::lock_guard<std::mutex> lg(gMutex);
std::lock_guard<std::mutex> lg(*gMutex);
gl::InitializeDebugAnnotations(gGlobalAnnotator.get());
}