From 7c86c5997d72062191c2fb4fbaf003bf48485842 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 18 Feb 2016 21:30:10 +0000 Subject: Use boost::thread instead of std::thread std::thread crashes on (at least) ARMv6 g++ 4.8/4.9 --- src/p2p/data_logger.cpp | 3 ++- src/p2p/net_node.h | 2 +- src/p2p/net_node.inl | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/p2p') diff --git a/src/p2p/data_logger.cpp b/src/p2p/data_logger.cpp index f875cb8f0..7fc85e3bc 100644 --- a/src/p2p/data_logger.cpp +++ b/src/p2p/data_logger.cpp @@ -31,6 +31,7 @@ #include #include +#include #include #include "../../contrib/otshell_utils/utils.hpp" @@ -85,7 +86,7 @@ namespace net_utils _info_c("dbg/data","Creating thread for data logger"); // create timer thread m_thread_maybe_running=true; - std::shared_ptr logger_thread(new std::thread([&]() { + std::shared_ptr logger_thread(new boost::thread([&]() { _info_c("dbg/data","Inside thread for data logger"); while (m_state == data_logger_state::state_during_init) { // wait for creation to be done (in other thread, in singleton) before actually running std::this_thread::sleep_for(std::chrono::seconds(1)); diff --git a/src/p2p/net_node.h b/src/p2p/net_node.h index 2ae849e2a..260dd813d 100644 --- a/src/p2p/net_node.h +++ b/src/p2p/net_node.h @@ -270,7 +270,7 @@ namespace nodetool bool m_offline; std::atomic m_save_graph; std::atomic is_closing; - std::unique_ptr mPeersLoggerThread; + std::unique_ptr mPeersLoggerThread; //critical_section m_connections_lock; //connections_indexed_container m_connections; diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index 47a5dc6c3..56717ec66 100644 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -567,7 +567,7 @@ namespace nodetool bool node_server::run() { // creating thread to log number of connections - mPeersLoggerThread.reset(new std::thread([&]() + mPeersLoggerThread.reset(new boost::thread([&]() { _note("Thread monitor number of peers - start"); while (!is_closing && !m_net_server.is_stop_signal_sent()) -- cgit v1.2.3