diff options
author | Riccardo Spagni <ric@spagni.net> | 2016-02-20 17:10:51 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2016-02-20 17:10:51 +0200 |
commit | c3baa82ac8e60da16ff0ad3af58c4ee495e898ab (patch) | |
tree | 398ec9d6e58debe889b76a51f743658c6c63fa67 /src | |
parent | Merge pull request #677 (diff) | |
parent | Fix crash in std::map for connections_map (diff) | |
download | monero-c3baa82ac8e60da16ff0ad3af58c4ee495e898ab.tar.xz |
Merge pull request #678
11d555c Fix crash in std::map for connections_map (Howard Chu)
014f886 std::condvar is broken on Win32 with gcc/g++ 4.8 too (Howard Chu)
7c86c59 Use boost::thread instead of std::thread (Howard Chu)
Diffstat (limited to 'src')
-rw-r--r-- | src/common/dns_utils.cpp | 4 | ||||
-rw-r--r-- | src/p2p/data_logger.cpp | 3 | ||||
-rw-r--r-- | src/p2p/net_node.h | 2 | ||||
-rw-r--r-- | src/p2p/net_node.inl | 2 |
4 files changed, 6 insertions, 5 deletions
diff --git a/src/common/dns_utils.cpp b/src/common/dns_utils.cpp index eb7b6608b..eb0a7de1f 100644 --- a/src/common/dns_utils.cpp +++ b/src/common/dns_utils.cpp @@ -38,7 +38,7 @@ using namespace epee; namespace bf = boost::filesystem; -static std::mutex instance_lock; +static boost::mutex instance_lock; namespace { @@ -304,7 +304,7 @@ std::string DNSResolver::get_dns_format_from_oa_address(const std::string& oa_ad DNSResolver& DNSResolver::instance() { - std::lock_guard<std::mutex> lock(instance_lock); + boost::lock_guard<boost::mutex> lock(instance_lock); static DNSResolver* staticInstance = NULL; if (staticInstance == NULL) 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 <boost/chrono.hpp> #include <boost/filesystem.hpp> +#include <boost/thread.hpp> #include <chrono> #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<std::thread> logger_thread(new std::thread([&]() { + std::shared_ptr<boost::thread> 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<bool> m_save_graph; std::atomic<bool> is_closing; - std::unique_ptr<std::thread> mPeersLoggerThread; + std::unique_ptr<boost::thread> 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<t_payload_net_handler>::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()) |