mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-10 20:22:31 +00:00
* Rewrote 'select' based polling in the client and finished the
'epoll' code. The client selects whichever is available on the current platform. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@510 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+10
-6
@@ -196,8 +196,8 @@ initialize_display(ui::Control* c) {
|
||||
|
||||
void
|
||||
initialize_core(ui::Control* c) {
|
||||
c->get_core().get_poll().slot_read_stdin(sigc::mem_fun(c->get_input(), &input::Manager::pressed));
|
||||
c->get_core().get_poll().slot_select_interrupted(sigc::ptr_fun(display::Canvas::do_update));
|
||||
c->get_core().get_poll_manager()->signal_interrupted().connect(sigc::mem_fun(c->get_input_stdin(), &input::InputEvent::event_read));
|
||||
c->get_core().get_poll_manager()->signal_interrupted().connect(sigc::ptr_fun(display::Canvas::do_update));
|
||||
|
||||
c->get_core().initialize();
|
||||
}
|
||||
@@ -223,7 +223,7 @@ main(int argc, char** argv) {
|
||||
SignalHandler::set_handler(SIGFPE, sigc::bind(sigc::ptr_fun(&do_panic), SIGFPE));
|
||||
|
||||
// Need to initialize this before parseing options.
|
||||
torrent::initialize(uiControl.get_core().get_poll().get_torrent_poll());
|
||||
torrent::initialize(uiControl.get_core().get_poll_manager()->get_torrent_poll());
|
||||
|
||||
if (getenv("HOME"))
|
||||
load_option_file(getenv("HOME") + std::string("/.rtorrent.rc"), &optionHandler);
|
||||
@@ -235,6 +235,8 @@ main(int argc, char** argv) {
|
||||
|
||||
uiControl.get_ui().init(&uiControl);
|
||||
|
||||
uiControl.initialize();
|
||||
|
||||
load_session_torrents(&uiControl);
|
||||
load_arg_torrents(&uiControl, argv + firstArg, argv + argc);
|
||||
|
||||
@@ -251,11 +253,13 @@ main(int argc, char** argv) {
|
||||
uiControl.get_display().do_update();
|
||||
|
||||
// Do shutdown check before poll, not after.
|
||||
uiControl.get_core().get_poll().poll(!utils::taskScheduler.empty() ?
|
||||
utils::taskScheduler.get_next_timeout() - utils::Timer::cache() :
|
||||
60 * 1000000);
|
||||
uiControl.get_core().get_poll_manager()->poll(!utils::taskScheduler.empty() ?
|
||||
utils::taskScheduler.get_next_timeout() - utils::Timer::cache() :
|
||||
60 * 1000000);
|
||||
}
|
||||
|
||||
uiControl.cleanup();
|
||||
|
||||
uiControl.get_ui().cleanup();
|
||||
uiControl.get_core().cleanup();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user