add debug configuration to debug shutdown-stall bugs / outstanding async operations
This commit is contained in:
@@ -37,6 +37,10 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "libtorrent/error_code.hpp"
|
||||
#include "libtorrent/error.hpp"
|
||||
|
||||
#if defined TORRENT_ASIO_DEBUGGING
|
||||
#include "libtorrent/debug.hpp"
|
||||
#endif
|
||||
|
||||
namespace libtorrent
|
||||
{
|
||||
|
||||
@@ -203,6 +207,9 @@ namespace libtorrent
|
||||
ptime expire = time_now_hires() + i->timeout;
|
||||
if (m_num_connecting == 0)
|
||||
{
|
||||
#if defined TORRENT_ASIO_DEBUGGING
|
||||
add_outstanding_async("connection_queue::on_timeout");
|
||||
#endif
|
||||
error_code ec;
|
||||
m_timer.expires_at(expire, ec);
|
||||
m_timer.async_wait(boost::bind(&connection_queue::on_timeout, this, _1));
|
||||
@@ -253,6 +260,9 @@ namespace libtorrent
|
||||
|
||||
void connection_queue::on_timeout(error_code const& e)
|
||||
{
|
||||
#if defined TORRENT_ASIO_DEBUGGING
|
||||
complete_async("connection_queue::on_timeout");
|
||||
#endif
|
||||
mutex_t::scoped_lock l(m_mutex);
|
||||
|
||||
INVARIANT_CHECK;
|
||||
@@ -302,6 +312,9 @@ namespace libtorrent
|
||||
|
||||
if (next_expire < max_time())
|
||||
{
|
||||
#if defined TORRENT_ASIO_DEBUGGING
|
||||
add_outstanding_async("connection_queue::on_timeout");
|
||||
#endif
|
||||
error_code ec;
|
||||
m_timer.expires_at(next_expire, ec);
|
||||
m_timer.async_wait(boost::bind(&connection_queue::on_timeout, this, _1));
|
||||
|
Reference in New Issue
Block a user