Merge pull request #404 from arvidn/asio-debugging-fix

fix asio debugging feature
This commit is contained in:
Arvid Norberg 2016-01-19 01:25:05 -05:00
commit 08247f738b
2 changed files with 14 additions and 14 deletions

View File

@ -395,6 +395,20 @@ namespace libtorrent
TORRENT_ASSERT(m_impl); TORRENT_ASSERT(m_impl);
TORRENT_ASYNC_CALL(abort); TORRENT_ASYNC_CALL(abort);
#if defined TORRENT_ASIO_DEBUGGING
int counter = 0;
while (log_async())
{
sleep(1000);
++counter;
printf("\x1b[2J\x1b[0;0H\x1b[33m==== Waiting to shut down: %d ==== \x1b[0m\n\n"
, counter);
}
async_dec_threads();
fprintf(stderr, "\n\nEXPECTS NO MORE ASYNC OPS\n\n\n");
#endif
if (m_thread && m_thread.unique()) if (m_thread && m_thread.unique())
m_thread->join(); m_thread->join();
} }

View File

@ -5832,20 +5832,6 @@ retry:
// this is not allowed to be the network thread! // this is not allowed to be the network thread!
// TORRENT_ASSERT(is_not_thread()); // TORRENT_ASSERT(is_not_thread());
#if defined TORRENT_ASIO_DEBUGGING
int counter = 0;
while (log_async())
{
sleep(1000);
++counter;
printf("\x1b[2J\x1b[0;0H\x1b[33m==== Waiting to shut down: %d ==== \x1b[0m\n\n"
, counter);
}
async_dec_threads();
fprintf(stderr, "\n\nEXPECTS NO MORE ASYNC OPS\n\n\n");
#endif
m_udp_socket.unsubscribe(this); m_udp_socket.unsubscribe(this);
m_udp_socket.unsubscribe(&m_utp_socket_manager); m_udp_socket.unsubscribe(&m_utp_socket_manager);
m_udp_socket.unsubscribe(&m_tracker_manager); m_udp_socket.unsubscribe(&m_tracker_manager);