1
0
Fork 0
forked from lthn/blockchain

android fix for new boost(1_72)

This commit is contained in:
cryptozoidberg 2021-06-01 23:20:24 +03:00
parent 9ff5e7a9ca
commit 8f12632ca6
No known key found for this signature in database
GPG key ID: 22DEB97A54C6FDEC

View file

@ -588,10 +588,18 @@ bool boosted_tcp_server<t_protocol_handler>::timed_wait_server_stop(uint64_t wai
TRY_ENTRY();
boost::chrono::milliseconds ms(wait_mseconds);
for(std::size_t i = 0; i < m_threads.size(); ++i) {
if(m_threads[i]->joinable() && !m_threads[i]->try_join_for(ms)) {
#ifdef ANDROID_BUILD
if (m_threads[i]->joinable())
{
m_threads[i]->join();
}
#else
if (m_threads[i]->joinable() && !m_threads[i]->try_join_for(ms))
{
LOG_PRINT_L0("Interrupting thread " << m_threads[i]->native_handle());
m_threads[i]->interrupt();
}
#endif
}
return true;
CATCH_ENTRY_L0("boosted_tcp_server<t_protocol_handler>::timed_wait_server_stop", false);