diff --git a/src/core/poll_manager_epoll.cc b/src/core/poll_manager_epoll.cc index f4b7b1f8..123efbf9 100644 --- a/src/core/poll_manager_epoll.cc +++ b/src/core/poll_manager_epoll.cc @@ -63,12 +63,12 @@ PollManagerEPoll::~PollManagerEPoll() { void PollManagerEPoll::poll(rak::timer timeout) { - static_cast(m_poll)->do_poll(); + static_cast(m_poll)->do_poll(timeout.usec()); } void PollManagerEPoll::poll_simple(rak::timer timeout) { - static_cast(m_poll)->do_poll(torrent::Poll::poll_worker_thread); + static_cast(m_poll)->do_poll(timeout.usec(), torrent::Poll::poll_worker_thread); } } diff --git a/src/core/poll_manager_kqueue.cc b/src/core/poll_manager_kqueue.cc index 572f35e4..82057ed5 100644 --- a/src/core/poll_manager_kqueue.cc +++ b/src/core/poll_manager_kqueue.cc @@ -64,12 +64,12 @@ PollManagerKQueue::~PollManagerKQueue() { void PollManagerKQueue::poll(rak::timer timeout) { - static_cast(m_poll)->do_poll(); + static_cast(m_poll)->do_poll(timeout.usec()); } void PollManagerKQueue::poll_simple(rak::timer timeout) { - static_cast(m_poll)->do_poll(torrent::Poll::poll_worker_thread); + static_cast(m_poll)->do_poll(timeout.usec(), torrent::Poll::poll_worker_thread); } } diff --git a/src/core/poll_manager_select.cc b/src/core/poll_manager_select.cc index 6d4827b9..bcd2d390 100644 --- a/src/core/poll_manager_select.cc +++ b/src/core/poll_manager_select.cc @@ -73,12 +73,14 @@ PollManagerSelect::~PollManagerSelect() { void PollManagerSelect::poll(rak::timer timeout) { - static_cast(m_poll)->do_poll(); + // timeout = std::min(timeout, rak::timer(torrent::next_timeout())) + 1000; + + static_cast(m_poll)->do_poll(timeout.usec()); } void PollManagerSelect::poll_simple(rak::timer timeout) { - static_cast(m_poll)->do_poll(torrent::PollSelect::poll_worker_thread); + static_cast(m_poll)->do_poll(timeout.usec(), torrent::PollSelect::poll_worker_thread); } } diff --git a/src/main.cc b/src/main.cc index 43474d6e..5dfdc987 100644 --- a/src/main.cc +++ b/src/main.cc @@ -878,7 +878,7 @@ main(int argc, char** argv) { rak::priority_queue_perform(&taskScheduler, cachedTime); // Do shutdown check before poll, not after. - main_thread->poll_manager()->poll(client_next_timeout(control)); + main_thread->poll()->do_poll(client_next_timeout(control).usec()); } control->core()->download_list()->session_save(); diff --git a/src/thread_base.h b/src/thread_base.h index 0698d9d8..5ac89ee2 100644 --- a/src/thread_base.h +++ b/src/thread_base.h @@ -59,7 +59,6 @@ public: ThreadBase(); virtual ~ThreadBase(); - core::PollManager* poll_manager() { return m_pollManager; } priority_queue& task_scheduler() { return m_taskScheduler; } virtual void init_thread() = 0;