diff options
author | Howard Chu <hyc@symas.com> | 2016-03-11 12:25:28 +0000 |
---|---|---|
committer | Howard Chu <hyc@symas.com> | 2016-03-11 15:09:50 +0000 |
commit | b937a2c915861900d047d4d4a24af31c454e3540 (patch) | |
tree | ceedf9b256b9769f72cb34319e4144ae127543dc /src/simplewallet | |
parent | Merge pull request #705 (diff) | |
download | monero-b937a2c915861900d047d4d4a24af31c454e3540.tar.xz |
Use boost::thread instead of std::thread
and all other associated IPC
Diffstat (limited to '')
-rw-r--r-- | src/simplewallet/simplewallet.cpp | 14 | ||||
-rw-r--r-- | src/simplewallet/simplewallet.h | 6 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 65508b9d5..3e5cdfcb6 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -445,7 +445,7 @@ bool simple_wallet::set_auto_refresh(const std::vector<std::string> &args/* = st if (auto_refresh && !m_auto_refresh_run.load(std::memory_order_relaxed)) { m_auto_refresh_run.store(true, std::memory_order_relaxed); - m_auto_refresh_thread = std::thread([&]{wallet_refresh_thread();}); + m_auto_refresh_thread = boost::thread([&]{wallet_refresh_thread();}); } else if (!auto_refresh && m_auto_refresh_run.load(std::memory_order_relaxed)) { @@ -1256,7 +1256,7 @@ bool simple_wallet::close_wallet() m_auto_refresh_run.store(false, std::memory_order_relaxed); m_wallet->stop(); { - std::unique_lock<std::mutex> lock(m_auto_refresh_mutex); + boost::unique_lock<boost::mutex> lock(m_auto_refresh_mutex); m_auto_refresh_cond.notify_one(); } m_auto_refresh_thread.join(); @@ -1341,7 +1341,7 @@ bool simple_wallet::start_mining(const std::vector<std::string>& args) req.miner_address = m_wallet->get_account().get_public_address_str(m_wallet->testnet()); bool ok = true; - size_t max_mining_threads_count = (std::max)(std::thread::hardware_concurrency(), static_cast<unsigned>(2)); + size_t max_mining_threads_count = (std::max)(boost::thread::hardware_concurrency(), static_cast<unsigned>(2)); if (0 == args.size()) { req.threads_count = 1; @@ -1458,7 +1458,7 @@ bool simple_wallet::refresh_main(uint64_t start_height, bool reset) m_auto_refresh_run.store(false, std::memory_order_relaxed); // stop any background refresh, and take over m_wallet->stop(); - std::unique_lock<std::mutex> lock(m_auto_refresh_mutex); + boost::unique_lock<boost::mutex> lock(m_auto_refresh_mutex); m_auto_refresh_cond.notify_one(); if (reset) @@ -2434,7 +2434,7 @@ void simple_wallet::wallet_refresh_thread() { while (true) { - std::unique_lock<std::mutex> lock(m_auto_refresh_mutex); + boost::unique_lock<boost::mutex> lock(m_auto_refresh_mutex); if (!m_auto_refresh_run.load(std::memory_order_relaxed)) break; m_auto_refresh_refreshing = true; @@ -2447,7 +2447,7 @@ void simple_wallet::wallet_refresh_thread() m_auto_refresh_refreshing = false; if (!m_auto_refresh_run.load(std::memory_order_relaxed)) break; - m_auto_refresh_cond.wait_for(lock, chrono::seconds(90)); + m_auto_refresh_cond.wait_for(lock, boost::chrono::seconds(90)); } } //---------------------------------------------------------------------------------------------------- @@ -2457,7 +2457,7 @@ bool simple_wallet::run() m_auto_refresh_run = m_wallet->auto_refresh(); if (m_auto_refresh_run) { - m_auto_refresh_thread = std::thread([&]{wallet_refresh_thread();}); + m_auto_refresh_thread = boost::thread([&]{wallet_refresh_thread();}); } else { diff --git a/src/simplewallet/simplewallet.h b/src/simplewallet/simplewallet.h index 5dac60447..d1617dbf4 100644 --- a/src/simplewallet/simplewallet.h +++ b/src/simplewallet/simplewallet.h @@ -242,9 +242,9 @@ namespace cryptonote std::atomic<bool> m_auto_refresh_run; bool m_auto_refresh_refreshing; - std::thread m_auto_refresh_thread; - std::mutex m_auto_refresh_mutex; - std::condition_variable m_auto_refresh_cond; + boost::thread m_auto_refresh_thread; + boost::mutex m_auto_refresh_mutex; + boost::condition_variable m_auto_refresh_cond; std::atomic<bool> m_in_manual_refresh; }; } |