mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-13 21:52:30 +00:00
* Allow interrupting a thread's polling through SIGUSR1. Used to signal events across threads.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1121 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -76,6 +76,8 @@ void do_panic(int signum);
|
||||
void print_help();
|
||||
void initialize_commands();
|
||||
|
||||
void do_nothing() {}
|
||||
|
||||
int
|
||||
parse_options(Control* c, int argc, char** argv) {
|
||||
try {
|
||||
@@ -174,6 +176,10 @@ main(int argc, char** argv) {
|
||||
SignalHandler::set_handler(SIGBUS, sigc::bind(sigc::ptr_fun(&do_panic), SIGBUS));
|
||||
SignalHandler::set_handler(SIGFPE, sigc::bind(sigc::ptr_fun(&do_panic), SIGFPE));
|
||||
|
||||
// SIGUSR1 is used for interrupting polling, forcing that thread
|
||||
// to process new non-socket events.
|
||||
SignalHandler::set_handler(SIGUSR1, sigc::ptr_fun(&do_nothing));
|
||||
|
||||
torrent::initialize(main_thread->poll());
|
||||
|
||||
// Initialize option handlers after libtorrent to ensure
|
||||
|
||||
Reference in New Issue
Block a user