diff options
author | Riccardo Spagni <ric@spagni.net> | 2016-09-18 17:21:44 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2016-09-18 17:36:40 +0200 |
commit | c15da0e70836ebc574ebcd4233cb61a5784b2db6 (patch) | |
tree | 95be35498f186c8c0065be58750ac20bd8036d0c /src/wallet/api/wallet.cpp | |
parent | Merge pull request #1094 (diff) | |
download | monero-c15da0e70836ebc574ebcd4233cb61a5784b2db6.tar.xz |
switch wallet API from std thread/mutex to boost
Diffstat (limited to '')
-rw-r--r-- | src/wallet/api/wallet.cpp | 8 |
1 files changed, 4 insertions, 4 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) { |