From f3d2187fadc65f02f17bc49d1d769601916ffc26 Mon Sep 17 00:00:00 2001 From: Ali Saeed Date: Sat, 16 Nov 2024 01:19:17 +0000 Subject: [PATCH] pw_bluetooth_proxy: Reintroduce std::lock_guard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Let's confirm this change can land without issue before migrating the rest of pw_bluetooth_proxy code back to std::lock_guard. Change-Id: Ied2b878fc518d6c9bba280329761862a28c3daa0 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/248713 Lint: Lint 🤖 Docs-Not-Needed: Ali Saeed Pigweed-Auto-Submit: Ali Saeed Reviewed-by: Ben Lawson Commit-Queue: Ali Saeed --- pw_bluetooth_proxy/acl_data_channel.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pw_bluetooth_proxy/acl_data_channel.cc b/pw_bluetooth_proxy/acl_data_channel.cc index 025c98aa2..284d42732 100644 --- a/pw_bluetooth_proxy/acl_data_channel.cc +++ b/pw_bluetooth_proxy/acl_data_channel.cc @@ -14,7 +14,7 @@ #include "pw_bluetooth_proxy/internal/acl_data_channel.h" -#include +#include #include "lib/stdcompat/utility.h" #include "pw_bluetooth/emboss_util.h" @@ -26,12 +26,11 @@ namespace pw::bluetooth::proxy { void AclDataChannel::Reset() { - credit_allocation_mutex_.lock(); + std::lock_guard lock(credit_allocation_mutex_); initialized_ = false; proxy_max_le_acl_packets_ = 0; proxy_pending_le_acl_packets_ = 0; active_connections_.clear(); - credit_allocation_mutex_.unlock(); } template