mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Add mutex guards for BLE publisher and watcher member variables to improve thread safety
PiperOrigin-RevId: 521611021
This commit is contained in:
committed by
Copybara-Service
parent
c312442f3d
commit
977275f069
@@ -112,12 +112,14 @@ class BleMedium : public api::BleMedium {
|
||||
|
||||
// WinRT objects
|
||||
::winrt::Windows::Devices::Bluetooth::Advertisement::
|
||||
BluetoothLEAdvertisementPublisher publisher_ = nullptr;
|
||||
BluetoothLEAdvertisementPublisher publisher_ ABSL_GUARDED_BY(mutex_) =
|
||||
nullptr;
|
||||
::winrt::Windows::Devices::Bluetooth::Advertisement::
|
||||
BluetoothLEAdvertisementWatcher watcher_ = nullptr;
|
||||
BluetoothLEAdvertisementWatcher watcher_ ABSL_GUARDED_BY(mutex_) =
|
||||
nullptr;
|
||||
|
||||
bool is_publisher_started_ = false;
|
||||
bool is_watcher_started_ = false;
|
||||
bool is_publisher_started_ ABSL_GUARDED_BY(mutex_) = false;
|
||||
bool is_watcher_started_ ABSL_GUARDED_BY(mutex_) = false;
|
||||
|
||||
::winrt::event_token publisher_token_;
|
||||
::winrt::event_token watcher_token_;
|
||||
|
||||
Reference in New Issue
Block a user