mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-04 21:29:21 +00:00
Merge remote-tracking branch 'origin/master' into xirvik
This commit is contained in:
@@ -66,3 +66,4 @@ TAGS
|
||||
###########################
|
||||
src/rtorrent
|
||||
test/rtorrentTest
|
||||
test-driver
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ AC_INIT(rtorrent, 0.9.3, jaris@ifi.uio.no)
|
||||
AC_DEFINE(API_VERSION, 8, api version)
|
||||
|
||||
AM_INIT_AUTOMAKE
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AC_CONFIG_HEADERS(config.h)
|
||||
AM_PATH_CPPUNIT(1.9.6)
|
||||
|
||||
AC_PROG_CXX
|
||||
|
||||
@@ -97,9 +97,6 @@ public:
|
||||
|
||||
void set_event_added(const std::string& name, const torrent::Object& cmd) { (*find_throw(name))->set_event_added(cmd); }
|
||||
void set_event_removed(const std::string& name, const torrent::Object& cmd) { (*find_throw(name))->set_event_removed(cmd); }
|
||||
|
||||
private:
|
||||
DownloadList* m_list;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -50,8 +50,7 @@ namespace display {
|
||||
|
||||
WindowDownloadTransferList::WindowDownloadTransferList(core::Download* d, unsigned int *focus) :
|
||||
Window(new Canvas, 0, 0, 0, extent_full, extent_full),
|
||||
m_download(d),
|
||||
m_focus(focus) {
|
||||
m_download(d) {
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -71,8 +71,6 @@ private:
|
||||
char key_id(torrent::BlockTransfer::key_type key);
|
||||
|
||||
core::Download* m_download;
|
||||
|
||||
unsigned int* m_focus;
|
||||
assigned_vector m_assigned;
|
||||
};
|
||||
|
||||
|
||||
+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");
|
||||
|
||||
+3
-3
@@ -169,12 +169,12 @@ SCgi::receive_call(SCgiTask* task, const char* buffer, uint32_t length) {
|
||||
slot_write slotWrite;
|
||||
slotWrite.set(rak::mem_fn(task, &SCgiTask::receive_write));
|
||||
|
||||
ThreadBase::acquire_global_lock();
|
||||
ThreadBase::interrupt_main_polling();
|
||||
torrent::thread_base::acquire_global_lock();
|
||||
torrent::main_thread()->interrupt();
|
||||
|
||||
bool result = xmlrpc.process(buffer, length, slotWrite);
|
||||
|
||||
ThreadBase::release_global_lock();
|
||||
torrent::thread_base::release_global_lock();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
+1
-16
@@ -160,20 +160,5 @@ ThreadBase::queue_item(thread_base_func newFunc) {
|
||||
|
||||
// Make it also restart inactive threads?
|
||||
if (m_state == STATE_ACTIVE)
|
||||
pthread_kill(m_thread, SIGUSR1);
|
||||
}
|
||||
|
||||
void
|
||||
ThreadBase::interrupt_main_polling() {
|
||||
int sleep_length = 0;
|
||||
|
||||
while (ThreadBase::is_main_polling()) {
|
||||
pthread_kill(torrent::main_thread()->pthread(), SIGUSR1);
|
||||
|
||||
if (!ThreadBase::is_main_polling())
|
||||
return;
|
||||
|
||||
usleep(sleep_length);
|
||||
sleep_length = std::min(sleep_length + 50, 1000);
|
||||
}
|
||||
interrupt();
|
||||
}
|
||||
|
||||
@@ -66,14 +66,6 @@ public:
|
||||
|
||||
void queue_item(thread_base_func newFunc);
|
||||
|
||||
// Only call this when global lock has been acquired, as it checks
|
||||
// ThreadBase::is_main_polling() which is only guaranteed to remain
|
||||
// 'false' if global lock keeps main thread from entering polling
|
||||
// again.
|
||||
//
|
||||
// Move to libtorrent some day.
|
||||
static void interrupt_main_polling();
|
||||
|
||||
protected:
|
||||
int64_t next_timeout_usec();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user