forked from premiere/premiere-libtorrent
add asserts in disk_fence_job
This commit is contained in:
parent
7e13b34158
commit
072563c973
|
@ -196,7 +196,7 @@ namespace libtorrent {
|
||||||
status_t ret = status_t::no_error;
|
status_t ret = status_t::no_error;
|
||||||
|
|
||||||
// flags controlling this job
|
// flags controlling this job
|
||||||
disk_job_flags_t flags{};
|
disk_job_flags_t flags = disk_job_flags_t{};
|
||||||
|
|
||||||
move_flags_t move_flags = move_flags_t::always_replace_files;
|
move_flags_t move_flags = move_flags_t::always_replace_files;
|
||||||
|
|
||||||
|
|
|
@ -2882,6 +2882,7 @@ constexpr disk_job_flags_t disk_interface::cache_hit;
|
||||||
|
|
||||||
disk_io_job* fj = allocate_job(job_action_t::flush_storage);
|
disk_io_job* fj = allocate_job(job_action_t::flush_storage);
|
||||||
fj->storage = j->storage;
|
fj->storage = j->storage;
|
||||||
|
TORRENT_ASSERT(fj->flags == disk_job_flags_t{});
|
||||||
|
|
||||||
int ret = j->storage->raise_fence(j, fj, m_stats_counters);
|
int ret = j->storage->raise_fence(j, fj, m_stats_counters);
|
||||||
if (ret == aux::disk_job_fence::fence_post_fence)
|
if (ret == aux::disk_job_fence::fence_post_fence)
|
||||||
|
|
|
@ -181,6 +181,7 @@ namespace libtorrent { namespace aux {
|
||||||
int disk_job_fence::raise_fence(disk_io_job* j, disk_io_job* fj
|
int disk_job_fence::raise_fence(disk_io_job* j, disk_io_job* fj
|
||||||
, counters& cnt)
|
, counters& cnt)
|
||||||
{
|
{
|
||||||
|
TORRENT_ASSERT(!(j->flags & disk_io_job::in_progress));
|
||||||
TORRENT_ASSERT(!(j->flags & disk_io_job::fence));
|
TORRENT_ASSERT(!(j->flags & disk_io_job::fence));
|
||||||
j->flags |= disk_io_job::fence;
|
j->flags |= disk_io_job::fence;
|
||||||
|
|
||||||
|
@ -214,6 +215,7 @@ namespace libtorrent { namespace aux {
|
||||||
#endif
|
#endif
|
||||||
m_blocked_jobs.push_back(fj);
|
m_blocked_jobs.push_back(fj);
|
||||||
cnt.inc_stats_counter(counters::blocked_disk_jobs);
|
cnt.inc_stats_counter(counters::blocked_disk_jobs);
|
||||||
|
TORRENT_ASSERT(!(j->flags & disk_io_job::in_progress));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue