diff options
author | Sven Gothel <[email protected]> | 2020-10-18 02:10:46 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-10-18 02:10:46 +0200 |
commit | bdb917ee94156981d4479241956a956b01e9d8bf (patch) | |
tree | 18582dd0b5cc6245e357f9a6adb276186f374a95 /api/direct_bt/DBTAdapter.hpp | |
parent | 8d9fb23d8524b424984201148d35a09bf030f8da (diff) |
DBTAdapter: Have statusListenerList lock-free using jau::cow_vector
Diffstat (limited to 'api/direct_bt/DBTAdapter.hpp')
-rw-r--r-- | api/direct_bt/DBTAdapter.hpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/api/direct_bt/DBTAdapter.hpp b/api/direct_bt/DBTAdapter.hpp index 2e0268b2..261b7091 100644 --- a/api/direct_bt/DBTAdapter.hpp +++ b/api/direct_bt/DBTAdapter.hpp @@ -35,6 +35,8 @@ #include <mutex> #include <atomic> +#include <jau/cow_vector.hpp> + #include "DBTTypes.hpp" #include "DBTDevice.hpp" @@ -190,11 +192,10 @@ namespace direct_bt { std::vector<std::shared_ptr<DBTDevice>> connectedDevices; std::vector<std::shared_ptr<DBTDevice>> discoveredDevices; // all discovered devices std::vector<std::shared_ptr<DBTDevice>> sharedDevices; // All active shared devices. Final holder of DBTDevice lifecycle! - std::vector<std::shared_ptr<AdapterStatusListener>> statusListenerList; + jau::cow_vector<std::shared_ptr<AdapterStatusListener>> statusListenerList; std::mutex mtx_discoveredDevices; std::mutex mtx_connectedDevices; std::recursive_mutex mtx_sharedDevices; // Final mutex of all DBTDevice lifecycle! - std::recursive_mutex mtx_statusListenerList; std::recursive_mutex mtx_discovery; bool validateDevInfo() noexcept; |