back port check to not destruct session_impl from its own thread
This commit is contained in:
parent
a623c4c41c
commit
4ac3d286a5
|
@ -271,6 +271,14 @@ namespace libtorrent
|
|||
#if defined BOOST_HAS_PTHREADS
|
||||
if (m_network_thread == 0) return true;
|
||||
return m_network_thread == pthread_self();
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
bool is_not_network_thread() const
|
||||
{
|
||||
#if defined BOOST_HAS_PTHREADS
|
||||
if (m_network_thread == 0) return true;
|
||||
return m_network_thread != pthread_self();
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -5940,6 +5940,8 @@ retry:
|
|||
|
||||
session_impl::~session_impl()
|
||||
{
|
||||
TORRENT_ASSERT(is_not_network_thread());
|
||||
|
||||
m_io_service.post(boost::bind(&session_impl::abort, this));
|
||||
|
||||
// we need to wait for the disk-io thread to
|
||||
|
|
Loading…
Reference in New Issue