diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-06-02 19:50:15 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-06-02 19:50:15 +0200 |
commit | abda8ae14a827586c8d6dd61509add4597b07212 (patch) | |
tree | 090076e8ac0700b6c2115d33a49c40041faa70e8 /CAN-binder/low-can-binding | |
parent | 7674529c84eced2a0b172811ac085a9b75fb6452 (diff) |
Let the thread to be managed outside the binding.
Change-Id: Ib905a3e0ea58a32761c4dda4a391c1d7b311c12a
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder/low-can-binding')
-rw-r--r-- | CAN-binder/low-can-binding/can/can-bus.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/CAN-binder/low-can-binding/can/can-bus.cpp b/CAN-binder/low-can-binding/can/can-bus.cpp index 78a823c..5e7ac27 100644 --- a/CAN-binder/low-can-binding/can/can-bus.cpp +++ b/CAN-binder/low-can-binding/can/can-bus.cpp @@ -206,13 +206,11 @@ void can_bus_t::start_threads() { is_decoding_ = true; th_decoding_ = std::thread(&can_bus_t::can_decode_message, this); - if(!th_decoding_.joinable()) - is_decoding_ = false; + th_decoding_.detach(); is_pushing_ = true; th_pushing_ = std::thread(&can_bus_t::can_event_push, this); - if(!th_pushing_.joinable()) - is_pushing_ = false; + th_pushing_.detach(); } /// @brief Will stop all threads holded by can_bus_t object |