diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-04-26 22:40:57 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-04-26 22:40:57 +0100 |
commit | d7bb1752ebae70e94a9e7d89e2a798e1641d6df0 (patch) | |
tree | 8bb20b0b950eca706b6c1657fb3aae794a30f04d /src/simplewallet/simplewallet.cpp | |
parent | Merge pull request #816 (diff) | |
download | monero-d7bb1752ebae70e94a9e7d89e2a798e1641d6df0.tar.xz |
simplewallet: more threading fixes
Diffstat (limited to 'src/simplewallet/simplewallet.cpp')
-rw-r--r-- | src/simplewallet/simplewallet.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 021e79edb..9b6c57d3d 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -82,8 +82,12 @@ typedef cryptonote::simple_wallet sw; m_auto_refresh_run.store(false, std::memory_order_relaxed); \ /* stop any background refresh, and take over */ \ m_wallet->stop(); \ - boost::unique_lock<boost::mutex> lock(m_auto_refresh_mutex); \ + m_auto_refresh_mutex.lock(); \ m_auto_refresh_cond.notify_one(); \ + m_auto_refresh_mutex.unlock(); \ + if (auto_refresh_run) \ + m_auto_refresh_thread.join(); \ + boost::unique_lock<boost::mutex> lock(m_auto_refresh_mutex); \ epee::misc_utils::auto_scope_leave_caller scope_exit_handler = epee::misc_utils::create_scope_leave_handler([&](){ \ m_auto_refresh_run.store(auto_refresh_run, std::memory_order_relaxed); \ if (auto_refresh_run) \ |