remove unused clear_read_cache function

This commit is contained in:
arvidn 2016-11-05 20:28:55 -04:00 committed by Arvid Norberg
parent 6691531ebb
commit c72053a75c
3 changed files with 0 additions and 19 deletions

View File

@ -82,7 +82,6 @@ namespace libtorrent
virtual void async_tick_torrent(piece_manager* storage
, std::function<void(disk_io_job const*)> handler) = 0;
virtual void clear_read_cache(piece_manager* storage) = 0;
virtual void async_clear_piece(piece_manager* storage, int index
, std::function<void(disk_io_job const*)> handler) = 0;
virtual void clear_piece(piece_manager* storage, int index) = 0;

View File

@ -320,7 +320,6 @@ namespace libtorrent
void async_tick_torrent(piece_manager* storage
, std::function<void(disk_io_job const*)> handler) override;
void clear_read_cache(piece_manager* storage) override;
void async_clear_piece(piece_manager* storage, int index
, std::function<void(disk_io_job const*)> handler) override;
// this is not asynchronous and requires that the piece does not

View File

@ -1944,23 +1944,6 @@ namespace libtorrent
add_job(j);
}
void disk_io_thread::clear_read_cache(piece_manager* storage)
{
std::unique_lock<std::mutex> l(m_cache_mutex);
jobqueue_t jobs;
auto const& cache = storage->cached_pieces();
// note that i is incremented in the body!
for (auto i = cache.begin(), end(cache.end()); i != end; )
{
jobqueue_t temp;
if (m_disk_cache.evict_piece(*(i++), temp))
jobs.append(temp);
}
fail_jobs(storage_error(boost::asio::error::operation_aborted), jobs);
}
void disk_io_thread::async_clear_piece(piece_manager* storage, int index
, std::function<void(disk_io_job const*)> handler)
{