Skip to content

Commit

Permalink
pw_bluetooth_proxy: Reintroduce std::lock_guard
Browse files Browse the repository at this point in the history
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 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Docs-Not-Needed: Ali Saeed <saeedali@google.com>
Pigweed-Auto-Submit: Ali Saeed <saeedali@google.com>
Reviewed-by: Ben Lawson <benlawson@google.com>
Commit-Queue: Ali Saeed <saeedali@google.com>
  • Loading branch information
acsaeed authored and CQ Bot Account committed Nov 16, 2024
1 parent 144c028 commit f3d2187
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pw_bluetooth_proxy/acl_data_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include "pw_bluetooth_proxy/internal/acl_data_channel.h"

#include <cstdint>
#include <mutex>

#include "lib/stdcompat/utility.h"
#include "pw_bluetooth/emboss_util.h"
Expand All @@ -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 <class EventT>
Expand Down

0 comments on commit f3d2187

Please sign in to comment.