aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2016-09-18 20:26:38 +0200
committerRiccardo Spagni <ric@spagni.net>2016-09-18 20:26:39 +0200
commit68e6678ab77f6ba731a8517eb3941b4e554acfc5 (patch)
tree43cd3974ef9c418660f3f882ca1e86137e71236d /src/wallet
parentMerge branch 'NanoAkron-armv8-march-crypto' (diff)
parentfix v5 height (diff)
downloadmonero-68e6678ab77f6ba731a8517eb3941b4e554acfc5.tar.xz
Merge pull request #1099
c2faab5 fix v5 height (Riccardo Spagni) 70bd7d8 remove dead backup seed nodes, add new ones (Riccardo Spagni) cebbcf0 fix v5 fork date description (Riccardo Spagni) eb60fa2 update version (Riccardo Spagni) c41098a updated fork heights for v4 and v5 (Riccardo Spagni) c69b8a1 update block headers (Riccardo Spagni) f148af2 add checkpoints (Riccardo Spagni) c15da0e switch wallet API from std thread/mutex to boost (Riccardo Spagni) 8a274ea switch wallet API from std thread/mutex to boost (Riccardo Spagni)
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/api/wallet.cpp8
-rw-r--r--src/wallet/api/wallet.h14
2 files changed, 11 insertions, 11 deletions
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
index 25a20a575..74552bc03 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
@@ -170,7 +170,7 @@ WalletImpl::WalletImpl(bool testnet)
m_refreshThreadDone = false;
m_refreshEnabled = false;
m_refreshIntervalSeconds = DEFAULT_REFRESH_INTERVAL_SECONDS;
- m_refreshThread = std::thread([this] () {
+ m_refreshThread = boost::thread([this] () {
this->refreshThreadFunc();
});
@@ -632,12 +632,12 @@ void WalletImpl::refreshThreadFunc()
LOG_PRINT_L3(__FUNCTION__ << ": starting refresh thread");
while (true) {
- std::unique_lock<std::mutex> lock(m_refreshMutex);
+ boost::mutex::scoped_lock lock(m_refreshMutex);
if (m_refreshThreadDone) {
break;
}
LOG_PRINT_L3(__FUNCTION__ << ": waiting for refresh...");
- m_refreshCV.wait_for(lock, std::chrono::seconds(m_refreshIntervalSeconds));
+ m_refreshCV.wait(lock);
LOG_PRINT_L3(__FUNCTION__ << ": refresh lock acquired...");
LOG_PRINT_L3(__FUNCTION__ << ": m_refreshEnabled: " << m_refreshEnabled);
LOG_PRINT_L3(__FUNCTION__ << ": m_status: " << m_status);
@@ -652,7 +652,7 @@ void WalletImpl::refreshThreadFunc()
void WalletImpl::doRefresh()
{
// synchronizing async and sync refresh calls
- std::lock_guard<std::mutex> guarg(m_refreshMutex2);
+ boost::lock_guard<boost::mutex> guarg(m_refreshMutex2);
try {
m_wallet->refresh();
} catch (const std::exception &e) {
diff --git a/src/wallet/api/wallet.h b/src/wallet/api/wallet.h
index 9a290e0bc..658296c30 100644
--- a/src/wallet/api/wallet.h
+++ b/src/wallet/api/wallet.h
@@ -35,9 +35,9 @@
#include "wallet/wallet2.h"
#include <string>
-#include <thread>
-#include <mutex>
-#include <condition_variable>
+#include <boost/thread/mutex.hpp>
+#include <boost/thread/thread.hpp>
+#include <boost/thread/condition_variable.hpp>
namespace Bitmonero {
@@ -113,12 +113,12 @@ private:
std::atomic<bool> m_refreshThreadDone;
std::atomic<int> m_refreshIntervalSeconds;
// synchronizing refresh loop;
- std::mutex m_refreshMutex;
+ boost::mutex m_refreshMutex;
// synchronizing sync and async refresh
- std::mutex m_refreshMutex2;
- std::condition_variable m_refreshCV;
- std::thread m_refreshThread;
+ boost::mutex m_refreshMutex2;
+ boost::condition_variable m_refreshCV;
+ boost::thread m_refreshThread;
};