reverted async. call to torrent::start() since it creates an undesirable race condition for file operations
This commit is contained in:
parent
a4dc107658
commit
dacb1ac48d
|
@ -210,7 +210,6 @@ namespace libtorrent
|
|||
|
||||
std::vector<torrent_handle> get_torrents();
|
||||
|
||||
void start_torrent(boost::weak_ptr<torrent> wt);
|
||||
void check_torrent(boost::shared_ptr<torrent> const& t);
|
||||
void done_checking(boost::shared_ptr<torrent> const& t);
|
||||
|
||||
|
|
|
@ -1878,7 +1878,7 @@ namespace aux {
|
|||
, params.storage, params.paused, params.resume_data
|
||||
, queue_pos, params.auto_managed));
|
||||
}
|
||||
m_io_service.post(bind(&session_impl::start_torrent, this, boost::weak_ptr<torrent>(torrent_ptr)));
|
||||
torrent_ptr->start();
|
||||
|
||||
#ifndef TORRENT_DISABLE_EXTENSIONS
|
||||
for (extension_list_t::iterator i = m_extensions.begin()
|
||||
|
@ -1922,20 +1922,6 @@ namespace aux {
|
|||
m_queued_for_checking.push_back(t);
|
||||
}
|
||||
|
||||
void session_impl::start_torrent(boost::weak_ptr<torrent> wt)
|
||||
{
|
||||
boost::shared_ptr<torrent> t = wt.lock();
|
||||
if (!t) return;
|
||||
|
||||
mutex_t::scoped_lock l(m_mutex);
|
||||
|
||||
INVARIANT_CHECK;
|
||||
|
||||
if (t->is_aborted()) return;
|
||||
|
||||
t->start();
|
||||
}
|
||||
|
||||
void session_impl::done_checking(boost::shared_ptr<torrent> const& t)
|
||||
{
|
||||
INVARIANT_CHECK;
|
||||
|
|
Loading…
Reference in New Issue