[dawn] Pass explicit template argument to std::lock_guard
A developer is reporting that these can warn with:
error: 'lock_guard' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
Change-Id: I01ffe43b7497c7179d3eafc55da57dc7f2425e7a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/175240
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Auto-Submit: Ben Clayton <bclayton@google.com>
diff --git a/src/dawn/native/Device.cpp b/src/dawn/native/Device.cpp
index b6adac6..1b9f09b 100644
--- a/src/dawn/native/Device.cpp
+++ b/src/dawn/native/Device.cpp
@@ -672,7 +672,7 @@
}
void DeviceBase::APISetLoggingCallback(wgpu::LoggingCallback callback, void* userdata) {
- std::lock_guard lock(mLoggingMutex);
+ std::lock_guard<std::shared_mutex> lock(mLoggingMutex);
mLoggingCallback = callback;
mLoggingUserdata = userdata;
}
diff --git a/src/dawn/tests/benchmarks/NullDeviceSetup.cpp b/src/dawn/tests/benchmarks/NullDeviceSetup.cpp
index f8feab0..203508c 100644
--- a/src/dawn/tests/benchmarks/NullDeviceSetup.cpp
+++ b/src/dawn/tests/benchmarks/NullDeviceSetup.cpp
@@ -48,7 +48,7 @@
if (state.thread_index() == 0) {
// Only thread 0 is responsible for initializing the device on each iteration.
{
- std::lock_guard lock(mMutex);
+ std::lock_guard<std::mutex> lock(mMutex);
// Get an adapter to create the device with.
wgpu::RequestAdapterOptions options = {};
@@ -104,7 +104,7 @@
} else {
bool isDone = false;
{
- std::lock_guard lock(mMutex);
+ std::lock_guard<std::mutex> lock(mMutex);
mNumDoneThreads += 1;
isDone = mNumDoneThreads == state.threads() - 1;
}