mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-15 22:52:31 +00:00
Use thread_base::interrupt for all SIGUSR1 interrupt signals and don't set a handler if it's not supported.
This commit is contained in:
+9
-3
@@ -202,9 +202,15 @@ main(int argc, char** argv) {
|
||||
|
||||
SignalHandler::set_sigaction_handler(SIGBUS, &handle_sigbus);
|
||||
|
||||
// SIGUSR1 is used for interrupting polling, forcing that thread
|
||||
// to process new non-socket events.
|
||||
SignalHandler::set_handler(SIGUSR1, sigc::ptr_fun(&do_nothing));
|
||||
// SIGUSR1 is used for interrupting polling, forcing the target
|
||||
// thread to process new non-socket events.
|
||||
//
|
||||
// LibTorrent uses sockets for this purpose on Solaris and other
|
||||
// platforms that do not properly pass signals to the target
|
||||
// threads. Use '--enable-interrupt-socket' when configuring
|
||||
// LibTorrent to enable this workaround.
|
||||
if (torrent::thread_base::should_handle_sigusr1())
|
||||
SignalHandler::set_handler(SIGUSR1, sigc::ptr_fun(&do_nothing));
|
||||
|
||||
torrent::log_add_group_output(torrent::LOG_NOTICE, "important");
|
||||
torrent::log_add_group_output(torrent::LOG_INFO, "complete");
|
||||
|
||||
Reference in New Issue
Block a user