From 8045a0a2b02d2fb8848aaadf4bada1ff8b1e35e5 Mon Sep 17 00:00:00 2001 From: woodser Date: Fri, 10 Jan 2020 07:24:42 -0500 Subject: [PATCH] start wallet sync thread unless single-threaded emscripten --- src/wallet/monero_wallet_core.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/wallet/monero_wallet_core.cpp b/src/wallet/monero_wallet_core.cpp index 39e09e5..4832e44 100644 --- a/src/wallet/monero_wallet_core.cpp +++ b/src/wallet/monero_wallet_core.cpp @@ -3237,15 +3237,14 @@ namespace monero { m_syncing_thread_done = false; m_syncing_interval = DEFAULT_SYNC_INTERVAL_MILLIS; - // TODO: tools::get_max_concurrency() w/o pthreads correctly returns 1 on Safari but 8 on Chrome which fails in common/threadpool constructor - #ifndef __EMSCRIPTEN_PTHREADS__ - tools::set_max_concurrency(1); + // start auto sync loop unless single-threaded emscripten + #if !defined(__EMSCRIPTEN__) || defined(__EMSCRIPTEN_PTHREADS__) + m_syncing_thread = boost::thread([this]() { + this->sync_thread_func(); + }); + #elif + tools::set_max_concurrency(1); // TODO: single-threaded emscripten tools::get_max_concurrency() correctly returns 1 on Safari but 8 on Chrome which fails in common/threadpool constructor #endif - -// // start auto sync loop -// m_syncing_thread = boost::thread([this]() { -// this->sync_thread_func(); -// }); } // private helper to initialize subaddresses using transfer details