diff options
author | Sven Gothel <[email protected]> | 2022-01-12 05:33:24 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2022-01-12 05:33:24 +0100 |
commit | cebf97bb657eeccf78173d56841821283b3c18b8 (patch) | |
tree | ef6de526520df740f18051017af1d07a22fa773f /api | |
parent | 0bf7ad16c308136750d3939c6f8ffdfe35d7871b (diff) |
BTManager: Use jau::service_runner
Diffstat (limited to 'api')
-rw-r--r-- | api/direct_bt/BTManager.hpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/api/direct_bt/BTManager.hpp b/api/direct_bt/BTManager.hpp index 90029971..ce422078 100644 --- a/api/direct_bt/BTManager.hpp +++ b/api/direct_bt/BTManager.hpp @@ -40,6 +40,7 @@ #include <jau/darray.hpp> #include <jau/cow_darray.hpp> #include <jau/octets.hpp> +#include <jau/service_runner.hpp> #include "BTTypes0.hpp" #include "BTIoctl.hpp" @@ -230,13 +231,8 @@ namespace direct_bt { jau::POctets rbuffer; HCIComm comm; + jau::service_runner mgmt_reader_service; jau::ringbuffer<std::unique_ptr<MgmtEvent>, jau::nsize_t> mgmtEventRing; - jau::sc_atomic_bool mgmtReaderShallStop; - - std::mutex mtx_mgmtReaderLifecycle; - std::condition_variable cv_mgmtReaderInit; - pthread_t mgmtReaderThreadId; - jau::sc_atomic_bool mgmtReaderRunning; std::recursive_mutex mtx_sendReply; // for send() and sendWithReply() @@ -260,7 +256,8 @@ namespace direct_bt { */ jau::darray<SMPIOCapability> adapterIOCapability; - void mgmtReaderThreadImpl() noexcept; + void mgmtReaderWork(jau::service_runner& sr) noexcept; + void mgmtReaderEndLocked(jau::service_runner& sr) noexcept; /** * In case response size check or devID and optional opcode validation fails, |