forked from premiere/premiere-libtorrent
raise priority of cache_flushed_alert and post it unconditionally when triggered explicily by the client
This commit is contained in:
parent
b60912569f
commit
d2d35b69fd
|
@ -1630,7 +1630,7 @@ namespace libtorrent
|
||||||
// internal
|
// internal
|
||||||
cache_flushed_alert(aux::stack_allocator& alloc, torrent_handle const& h);
|
cache_flushed_alert(aux::stack_allocator& alloc, torrent_handle const& h);
|
||||||
|
|
||||||
TORRENT_DEFINE_ALERT(cache_flushed_alert, 58)
|
TORRENT_DEFINE_ALERT_PRIO(cache_flushed_alert, 58, alert_priority_high)
|
||||||
|
|
||||||
static const int static_category = alert::storage_notification;
|
static const int static_category = alert::storage_notification;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1164,7 +1164,7 @@ namespace libtorrent
|
||||||
void on_storage_moved(disk_io_job const* j);
|
void on_storage_moved(disk_io_job const* j);
|
||||||
void on_save_resume_data(disk_io_job const* j);
|
void on_save_resume_data(disk_io_job const* j);
|
||||||
void on_file_renamed(disk_io_job const* j);
|
void on_file_renamed(disk_io_job const* j);
|
||||||
void on_cache_flushed(disk_io_job const* j);
|
void on_cache_flushed(disk_io_job const* j, bool manually_triggered);
|
||||||
|
|
||||||
// this is used when a torrent is being removed.It synchronizes with the
|
// this is used when a torrent is being removed.It synchronizes with the
|
||||||
// disk thread
|
// disk thread
|
||||||
|
|
|
@ -8701,7 +8701,7 @@ namespace {
|
||||||
// we need to keep the object alive during this operation
|
// we need to keep the object alive during this operation
|
||||||
inc_refcount("release_files");
|
inc_refcount("release_files");
|
||||||
m_ses.disk_thread().async_release_files(m_storage.get()
|
m_ses.disk_thread().async_release_files(m_storage.get()
|
||||||
, boost::bind(&torrent::on_cache_flushed, shared_from_this(), _1));
|
, boost::bind(&torrent::on_cache_flushed, shared_from_this(), _1, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
// this torrent just completed downloads, which means it will fall
|
// this torrent just completed downloads, which means it will fall
|
||||||
|
@ -9881,17 +9881,17 @@ namespace {
|
||||||
}
|
}
|
||||||
inc_refcount("release_files");
|
inc_refcount("release_files");
|
||||||
m_ses.disk_thread().async_release_files(m_storage.get()
|
m_ses.disk_thread().async_release_files(m_storage.get()
|
||||||
, boost::bind(&torrent::on_cache_flushed, shared_from_this(), _1));
|
, boost::bind(&torrent::on_cache_flushed, shared_from_this(), _1, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
void torrent::on_cache_flushed(disk_io_job const*)
|
void torrent::on_cache_flushed(disk_io_job const*, bool const manually_triggered)
|
||||||
{
|
{
|
||||||
dec_refcount("release_files");
|
dec_refcount("release_files");
|
||||||
TORRENT_ASSERT(is_single_thread());
|
TORRENT_ASSERT(is_single_thread());
|
||||||
|
|
||||||
if (m_ses.is_aborted()) return;
|
if (m_ses.is_aborted()) return;
|
||||||
|
|
||||||
if (alerts().should_post<cache_flushed_alert>())
|
if (manually_triggered || alerts().should_post<cache_flushed_alert>())
|
||||||
alerts().emplace_alert<cache_flushed_alert>(get_handle());
|
alerts().emplace_alert<cache_flushed_alert>(get_handle());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue