fix asio debugging feature

This commit is contained in:
arvidn 2016-01-18 23:13:50 -05:00
parent 595fe157a9
commit 784f8806a4
2 changed files with 14 additions and 14 deletions

View File

@ -395,6 +395,20 @@ namespace libtorrent
TORRENT_ASSERT(m_impl);
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())
m_thread->join();
}

View File

@ -5832,20 +5832,6 @@ retry:
// this is not allowed to be the network 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(&m_utp_socket_manager);
m_udp_socket.unsubscribe(&m_tracker_manager);