From 33a2abebfe2e1839c4aa196694d4587805b1ef26 Mon Sep 17 00:00:00 2001 From: arvidn Date: Tue, 18 Jul 2017 10:03:37 +0300 Subject: [PATCH] submit disk jobs in read_piece() --- include/libtorrent/disk_interface.hpp | 2 ++ include/libtorrent/disk_io_thread.hpp | 2 +- src/torrent.cpp | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/libtorrent/disk_interface.hpp b/include/libtorrent/disk_interface.hpp index 9f43c8153..193f9b4a5 100644 --- a/include/libtorrent/disk_interface.hpp +++ b/include/libtorrent/disk_interface.hpp @@ -176,6 +176,8 @@ namespace libtorrent { virtual std::vector get_status(storage_index_t) const = 0; + virtual void submit_jobs() = 0; + #if TORRENT_USE_ASSERTS virtual bool is_disk_buffer(char* buffer) const = 0; #endif diff --git a/include/libtorrent/disk_io_thread.hpp b/include/libtorrent/disk_io_thread.hpp index 7cc78e209..3977c6384 100644 --- a/include/libtorrent/disk_io_thread.hpp +++ b/include/libtorrent/disk_io_thread.hpp @@ -348,7 +348,7 @@ namespace aux { std::vector get_status(storage_index_t) const override; // this submits all queued up jobs to the thread - void submit_jobs(); + void submit_jobs() override; block_cache* cache() { return &m_disk_cache; } diff --git a/src/torrent.cpp b/src/torrent.cpp index 33d90b6cd..85f17445f 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -861,6 +861,7 @@ namespace libtorrent { , std::bind(&torrent::on_disk_read_complete , shared_from_this(), _1, _2, _3, r, rp)); } + m_ses.disk_thread().submit_jobs(); } void torrent::send_share_mode()