fix asio-debugging

This commit is contained in:
arvidn 2016-06-25 17:29:40 -04:00
parent 6917a11c6b
commit f56d698db6
2 changed files with 10 additions and 1 deletions

View File

@ -120,6 +120,9 @@ public:
// to avoid unnecessary copying of the handler,
// store it in a shaed_ptr
error_code e;
#if defined TORRENT_ASIO_DEBUGGING
add_outstanding_async("socks5_stream::connect1");
#endif
connect1(e, boost::make_shared<handler_type>(handler));
}

View File

@ -389,7 +389,13 @@ namespace libtorrent
int counter = 0;
while (log_async())
{
sleep(1000);
#if defined TORRENT_WINDOWS || defined TORRENT_CYGWIN
Sleep(1000);
#elif defined TORRENT_BEOS
snooze_until(system_time() + 1000000, B_SYSTEM_TIMEBASE);
#else
usleep(1000000);
#endif
++counter;
printf("\x1b[2J\x1b[0;0H\x1b[33m==== Waiting to shut down: %d ==== \x1b[0m\n\n"
, counter);