demote is_single_thread() assertion to invariant-check, in peer_connection

This commit is contained in:
arvidn 2018-11-25 21:17:04 +01:00 committed by Arvid Norberg
parent 88c733ef2d
commit ba2e0db6d5
1 changed files with 4 additions and 0 deletions

View File

@ -113,9 +113,13 @@ namespace libtorrent {
#if TORRENT_USE_ASSERTS
bool peer_connection::is_single_thread() const
{
#ifdef TORRENT_USE_INVARIANT_CHECKS
std::shared_ptr<torrent> t = m_torrent.lock();
if (!t) return true;
return t->is_single_thread();
#else
return true;
#endif
}
#endif