aboutsummaryrefslogtreecommitdiffstats
path: root/src/can-utils.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-02-21 13:21:59 +0000
committerRomain Forlot <romain.forlot@iot.bzh>2017-02-22 12:15:09 +0100
commitdae58e000ef198f7fa09718c60d7a7f2250fc2ce (patch)
treef02fecdb5da402561207bf4a92c1526ecf1bf513 /src/can-utils.cpp
parentb157cc6c5942ed0dfae672d2d3e32e0d7c6cb2ad (diff)
Fix: force to pass a ref at threads launch
Change-Id: Ife4206d6f6dce6888157239cce56b0040e3d2cf4 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/can-utils.cpp')
-rw-r--r--src/can-utils.cpp8
1 files changed, 4 insertions, 4 deletions
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));
}
/**