Converted to new TaskScheduler.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@474 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-06-23 19:23:36 +00:00
parent bc27fd19cb
commit 088398d6d6
10 changed files with 187 additions and 161 deletions
+9 -3
View File
@@ -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();