From 784f8806a496b0674dbdc9f131ac643061fd29eb Mon Sep 17 00:00:00 2001 From: arvidn Date: Mon, 18 Jan 2016 23:13:50 -0500 Subject: [PATCH] fix asio debugging feature --- src/session.cpp | 14 ++++++++++++++ src/session_impl.cpp | 14 -------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/session.cpp b/src/session.cpp index adacc0eb5..9d3913fda 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -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(); } diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 977582b6e..6f617b86a 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -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);