mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-11 04:32:30 +00:00
Converted to new TaskScheduler.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@474 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+9
-3
@@ -45,9 +45,9 @@
|
||||
#include "ui/root.h"
|
||||
#include "input/bindings.h"
|
||||
|
||||
#include "utils/task.h"
|
||||
#include "utils/timer.h"
|
||||
#include "utils/directory.h"
|
||||
#include "utils/task_schedule.h"
|
||||
|
||||
#include "signal_handler.h"
|
||||
#include "option_file.h"
|
||||
@@ -62,6 +62,10 @@ bool is_shutting_down = false;
|
||||
void do_panic(int signum);
|
||||
void print_help();
|
||||
|
||||
namespace utils {
|
||||
TaskScheduler taskScheduler;
|
||||
}
|
||||
|
||||
bool
|
||||
is_resized() {
|
||||
static int x = 0;
|
||||
@@ -220,13 +224,15 @@ main(int argc, char** argv) {
|
||||
}
|
||||
|
||||
utils::Timer::update();
|
||||
utils::TaskSchedule::perform(utils::Timer::cache());
|
||||
utils::taskScheduler.execute(utils::Timer::cache());
|
||||
|
||||
// This needs to be called every second or so. Currently done by
|
||||
// the throttle task in libtorrent.
|
||||
uiControl.get_display().do_update();
|
||||
|
||||
uiControl.get_core().get_poll().poll(utils::TaskSchedule::get_timeout());
|
||||
uiControl.get_core().get_poll().poll(!utils::taskScheduler.empty() ?
|
||||
utils::taskScheduler.get_next_timeout() - utils::Timer::cache() :
|
||||
60 * 1000000);
|
||||
}
|
||||
|
||||
uiRoot.cleanup();
|
||||
|
||||
Reference in New Issue
Block a user