From dae58e000ef198f7fa09718c60d7a7f2250fc2ce Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Tue, 21 Feb 2017 13:21:59 +0000 Subject: Fix: force to pass a ref at threads launch Change-Id: Ife4206d6f6dce6888157239cce56b0040e3d2cf4 Signed-off-by: Romain Forlot --- src/can-utils.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/can-utils.cpp') diff --git a/src/can-utils.cpp b/src/can-utils.cpp index 55daf440..a156df44 100644 --- a/src/can-utils.cpp +++ b/src/can-utils.cpp @@ -234,8 +234,8 @@ canfd_frame can_bus_dev_t::read(const struct afb_binding_interface* interface) */ void can_bus_dev_t::start_reading() { - th_reading_ = std::thread(can_reader, *this); - is_running_ = true; + th_reading_ = std::thread(can_reader, std::ref(*this)); + is_running_ = true; is_running_ = true; } /* @@ -339,8 +339,8 @@ can_bus_t::can_bus_t(const afb_binding_interface *itf, int& conf_file) */ void can_bus_t::start_threads() { - th_decoding_ = std::thread(can_decode_message, *this); - th_pushing_ = std::thread(can_event_push, *this); + th_decoding_ = std::thread(can_decode_message, std::ref(*this)); + th_pushing_ = std::thread(can_event_push, std::ref(*this)); } /** -- cgit 1.2.3-korg