From 26910eff1d3e7f2d553358a92073976ea1326d6c Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Wed, 28 Jan 2009 07:09:10 +0000 Subject: [PATCH] update_settings fixes for disk_io_thread --- src/disk_io_thread.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/disk_io_thread.cpp b/src/disk_io_thread.cpp index edf65708e..2754d562f 100644 --- a/src/disk_io_thread.cpp +++ b/src/disk_io_thread.cpp @@ -775,7 +775,9 @@ namespace libtorrent , boost::function const& f) { TORRENT_ASSERT(!j.callback); - TORRENT_ASSERT(j.storage); + TORRENT_ASSERT(j.storage + || j.action == disk_io_job::abort_thread + || j.action == disk_io_job::update_settings); TORRENT_ASSERT(j.buffer_size <= m_block_size); mutex_t::scoped_lock l(m_queue_mutex); @@ -826,12 +828,12 @@ namespace libtorrent k->callback.swap(const_cast&>(f)); if (j.action == disk_io_job::write) m_queue_buffer_size += j.buffer_size; - TORRENT_ASSERT(j.storage.get()); m_signal.notify_all(); } bool disk_io_thread::test_error(disk_io_job& j) { + TORRENT_ASSERT(j.storage); error_code const& ec = j.storage->error(); if (ec) { @@ -880,6 +882,7 @@ namespace libtorrent // released. disk_buffer_holder holder(*this , m_jobs.front().action != disk_io_job::check_fastresume + && m_jobs.front().action != disk_io_job::update_settings ? m_jobs.front().buffer : 0); boost::function handler; @@ -894,7 +897,9 @@ namespace libtorrent int ret = 0; - TORRENT_ASSERT(j.storage || j.action == disk_io_job::abort_thread); + TORRENT_ASSERT(j.storage + || j.action == disk_io_job::abort_thread + || j.action == disk_io_job::update_settings); #ifdef TORRENT_DISK_STATS ptime start = time_now(); #endif