Merge pull request #404 from arvidn/asio-debugging-fix
fix asio debugging feature
This commit is contained in:
commit
08247f738b
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue