diff options
author | hyc <hyc@symas.com> | 2017-04-12 23:51:18 +0100 |
---|---|---|
committer | hyc <hyc@symas.com> | 2017-04-12 23:51:18 +0100 |
commit | a3d779013db84b3a7d1199a12131a54c84f9caba (patch) | |
tree | d77aeba7a95526bf2a3af936de207ffe91fdf562 /src/cryptonote_core/blockchain.cpp | |
parent | Merge pull request #1956 (diff) | |
download | monero-a3d779013db84b3a7d1199a12131a54c84f9caba.tar.xz |
Fix block_longhash_worker thread
Wasn't getting its stack size initialized; crashes on Android
with a default stack size of 1MB.
Diffstat (limited to 'src/cryptonote_core/blockchain.cpp')
-rw-r--r-- | src/cryptonote_core/blockchain.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 0d5a8d46f..0727e9928 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -3665,6 +3665,8 @@ bool Blockchain::prepare_handle_incoming_blocks(const std::list<block_complete_e std::vector<std::unordered_map<crypto::hash, crypto::hash>> maps(threads); std::vector < std::vector < block >> blocks(threads); auto it = blocks_entry.begin(); + boost::thread::attributes attrs; + attrs.set_stack_size(THREAD_STACK_SIZE); for (uint64_t i = 0; i < threads; i++) { @@ -3724,7 +3726,7 @@ bool Blockchain::prepare_handle_incoming_blocks(const std::list<block_complete_e m_blocks_longhash_table.clear(); for (uint64_t i = 0; i < threads; i++) { - thread_list.push_back(new boost::thread(&Blockchain::block_longhash_worker, this, height + (i * batches), std::cref(blocks[i]), std::ref(maps[i]))); + thread_list.push_back(new boost::thread(attrs, boost::bind(&Blockchain::block_longhash_worker, this, height + (i * batches), std::cref(blocks[i]), std::ref(maps[i])))); } for (size_t j = 0; j < thread_list.size(); j++) |