Fix ctad-maybe-unsupported warning
The upcoming compiler warns about the following code pattern:
frameworks/native/libs/gui/SurfaceComposerClient.cpp:192:5: error: 'lock_guard' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported] std::lock_guard lock(mMutex);
Add explicit deduction guide to fix the warning.
Test: m checkbuild
Change-Id: I4b8b22cdd9b9714d0dfc56c1590a19fcdfbbeb07
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index 7a39222..050ba87 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -189,7 +189,7 @@
}
void TransactionCompletedListener::onTransactionCompleted(ListenerStats listenerStats) {
- std::lock_guard lock(mMutex);
+ std::lock_guard<std::mutex> lock(mMutex);
/* This listener knows all the sp<IBinder> to sp<SurfaceControl> for all its registered
* callbackIds, except for when Transactions are merged together. This probably cannot be
@@ -242,7 +242,7 @@
}
int32_t getId(const sp<GraphicBuffer>& buffer) {
- std::lock_guard lock(mMutex);
+ std::lock_guard<std::mutex> lock(mMutex);
auto itr = mBuffers.find(buffer);
if (itr == mBuffers.end()) {
@@ -253,7 +253,7 @@
}
int32_t cache(const sp<GraphicBuffer>& buffer) {
- std::lock_guard lock(mMutex);
+ std::lock_guard<std::mutex> lock(mMutex);
int32_t bufferId = getNextAvailableId();