aboutsummaryrefslogtreecommitdiffstats
path: root/api/direct_bt/DBTAdapter.hpp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-05-28 19:10:28 +0200
committerSven Gothel <[email protected]>2020-05-28 19:10:28 +0200
commit93c70956beddc007ba615b850401eb16cc9683dd (patch)
tree9fee37629c9130d42037870db767b9eae3a19b4f /api/direct_bt/DBTAdapter.hpp
parentfafc8db2ed2f2975148665e7224412b72ac03df2 (diff)
Use atomic as a memory barrier (data race), volatile is not suitable for multithreading.
Diffstat (limited to 'api/direct_bt/DBTAdapter.hpp')
-rw-r--r--api/direct_bt/DBTAdapter.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/api/direct_bt/DBTAdapter.hpp b/api/direct_bt/DBTAdapter.hpp
index 14badc12..0a9f6c87 100644
--- a/api/direct_bt/DBTAdapter.hpp
+++ b/api/direct_bt/DBTAdapter.hpp
@@ -160,7 +160,7 @@ namespace direct_bt {
std::recursive_mutex mtx_discoveredDevices;
std::recursive_mutex mtx_sharedDevices;
std::recursive_mutex mtx_statusListenerList;
- volatile bool keepDiscoveringAlive = false;
+ std::atomic<bool> keepDiscoveringAlive; // = false;
bool validateDevInfo();
@@ -196,7 +196,7 @@ namespace direct_bt {
void startDiscoveryBackground();
- void sendDeviceUpdated(std::shared_ptr<DBTDevice> device, uint64_t timestamp, EIRDataType updateMask);
+ void sendDeviceUpdated(std::string cause, std::shared_ptr<DBTDevice> device, uint64_t timestamp, EIRDataType updateMask);
public: