diff --git a/include/libtorrent/disk_io_thread.hpp b/include/libtorrent/disk_io_thread.hpp index dd9cfd14e..1ceb73289 100644 --- a/include/libtorrent/disk_io_thread.hpp +++ b/include/libtorrent/disk_io_thread.hpp @@ -46,7 +46,7 @@ POSSIBILITY OF SUCH DAMAGE. #include #include #include -#include +#include #include "libtorrent/config.hpp" #ifndef TORRENT_DISABLE_POOL_ALLOCATOR #include @@ -441,7 +441,7 @@ namespace libtorrent event m_signal; bool m_abort; bool m_waiting_to_shutdown; - std::list m_jobs; + std::deque m_jobs; size_type m_queue_buffer_size; ptime m_last_file_check; diff --git a/src/disk_io_thread.cpp b/src/disk_io_thread.cpp index 7fa98fd4e..27368bd74 100644 --- a/src/disk_io_thread.cpp +++ b/src/disk_io_thread.cpp @@ -358,7 +358,7 @@ namespace libtorrent { mutex::scoped_lock l(m_queue_mutex); // read jobs are aborted, write and move jobs are syncronized - for (std::list::iterator i = m_jobs.begin(); + for (std::deque::iterator i = m_jobs.begin(); i != m_jobs.end();) { if (i->storage != s) @@ -1862,7 +1862,7 @@ namespace libtorrent m_log << log_time() << " abort_torrent " << std::endl; #endif mutex::scoped_lock jl(m_queue_mutex); - for (std::list::iterator i = m_jobs.begin(); + for (std::deque::iterator i = m_jobs.begin(); i != m_jobs.end();) { if (i->storage != j.storage) @@ -1929,7 +1929,7 @@ namespace libtorrent // clear all read jobs mutex::scoped_lock jl(m_queue_mutex); - for (std::list::iterator i = m_jobs.begin(); + for (std::deque::iterator i = m_jobs.begin(); i != m_jobs.end();) { if (should_cancel_on_abort(*i))