aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authorHoward Chu <hyc@symas.com>2016-03-11 12:25:28 +0000
committerHoward Chu <hyc@symas.com>2016-03-11 15:09:50 +0000
commitb937a2c915861900d047d4d4a24af31c454e3540 (patch)
treeceedf9b256b9769f72cb34319e4144ae127543dc /src/wallet
parentMerge pull request #705 (diff)
downloadmonero-b937a2c915861900d047d4d4a24af31c454e3540.tar.xz
Use boost::thread instead of std::thread
and all other associated IPC
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/wallet2.cpp10
-rw-r--r--src/wallet/wallet2.h2
-rw-r--r--src/wallet/wallet_errors.h1
3 files changed, 7 insertions, 6 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index a86f2ffdf..389286ceb 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -204,7 +204,7 @@ void wallet2::process_new_transaction(const cryptonote::transaction& tx, uint64_
tx_pub_key = pub_key_field.pub_key;
bool r = true;
- int threads = std::thread::hardware_concurrency();
+ int threads = boost::thread::hardware_concurrency();
if (miner_tx && m_refresh_type == RefreshNoCoinbase)
{
// assume coinbase isn't for us
@@ -574,7 +574,7 @@ void wallet2::process_blocks(uint64_t start_height, const std::list<cryptonote::
size_t current_index = start_height;
blocks_added = 0;
- int threads = std::thread::hardware_concurrency();
+ int threads = boost::thread::hardware_concurrency();
if (threads > 1)
{
std::vector<crypto::hash> round_block_hashes(threads);
@@ -771,7 +771,7 @@ void wallet2::refresh(uint64_t start_height, uint64_t & blocks_fetched, bool& re
size_t try_count = 0;
crypto::hash last_tx_hash_id = m_transfers.size() ? get_transaction_hash(m_transfers.back().m_tx) : null_hash;
std::list<crypto::hash> short_chain_history;
- std::thread pull_thread;
+ boost::thread pull_thread;
uint64_t blocks_start_height;
std::list<cryptonote::block_complete_entry> blocks;
@@ -788,7 +788,7 @@ void wallet2::refresh(uint64_t start_height, uint64_t & blocks_fetched, bool& re
uint64_t next_blocks_start_height;
std::list<cryptonote::block_complete_entry> next_blocks;
bool error = false;
- pull_thread = std::thread([&]{pull_next_blocks(start_height, next_blocks_start_height, short_chain_history, blocks, next_blocks, error);});
+ pull_thread = boost::thread([&]{pull_next_blocks(start_height, next_blocks_start_height, short_chain_history, blocks, next_blocks, error);});
process_blocks(blocks_start_height, blocks, added_blocks);
blocks_fetched += added_blocks;
@@ -1312,7 +1312,7 @@ bool wallet2::prepare_file_names(const std::string& file_path)
//----------------------------------------------------------------------------------------------------
bool wallet2::check_connection()
{
- std::lock_guard<std::mutex> lock(m_daemon_rpc_mutex);
+ boost::lock_guard<boost::mutex> lock(m_daemon_rpc_mutex);
if(m_http_client.is_connected())
return true;
diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h
index ceeef492e..c79da2e15 100644
--- a/src/wallet/wallet2.h
+++ b/src/wallet/wallet2.h
@@ -407,7 +407,7 @@ namespace tools
std::atomic<bool> m_run;
- std::mutex m_daemon_rpc_mutex;
+ boost::mutex m_daemon_rpc_mutex;
i_wallet2_callback* m_callback;
bool m_testnet;
diff --git a/src/wallet/wallet_errors.h b/src/wallet/wallet_errors.h
index 10d27651f..80482c1ba 100644
--- a/src/wallet/wallet_errors.h
+++ b/src/wallet/wallet_errors.h
@@ -31,6 +31,7 @@
#pragma once
#include <stdexcept>
+#include <system_error>
#include <string>
#include <vector>