reverted async. call to torrent::start() since it creates an undesirable race condition for file operations

This commit is contained in:
Arvid Norberg 2009-01-02 08:58:51 +00:00
parent a4dc107658
commit dacb1ac48d
2 changed files with 1 additions and 16 deletions

View File

@ -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);

View File

@ -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;