Merge remote-tracking branch 'origin/master' into xirvik

This commit is contained in:
rakshasa
2013-06-13 23:08:15 +09:00
9 changed files with 16 additions and 38 deletions
+1
View File
@@ -66,3 +66,4 @@ TAGS
########################### ###########################
src/rtorrent src/rtorrent
test/rtorrentTest test/rtorrentTest
test-driver
+1 -1
View File
@@ -3,7 +3,7 @@ AC_INIT(rtorrent, 0.9.3, jaris@ifi.uio.no)
AC_DEFINE(API_VERSION, 8, api version) AC_DEFINE(API_VERSION, 8, api version)
AM_INIT_AUTOMAKE AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h) AC_CONFIG_HEADERS(config.h)
AM_PATH_CPPUNIT(1.9.6) AM_PATH_CPPUNIT(1.9.6)
AC_PROG_CXX AC_PROG_CXX
-3
View File
@@ -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_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); } void set_event_removed(const std::string& name, const torrent::Object& cmd) { (*find_throw(name))->set_event_removed(cmd); }
private:
DownloadList* m_list;
}; };
} }
+1 -2
View File
@@ -50,8 +50,7 @@ namespace display {
WindowDownloadTransferList::WindowDownloadTransferList(core::Download* d, unsigned int *focus) : WindowDownloadTransferList::WindowDownloadTransferList(core::Download* d, unsigned int *focus) :
Window(new Canvas, 0, 0, 0, extent_full, extent_full), Window(new Canvas, 0, 0, 0, extent_full, extent_full),
m_download(d), m_download(d) {
m_focus(focus) {
} }
void void
@@ -71,8 +71,6 @@ private:
char key_id(torrent::BlockTransfer::key_type key); char key_id(torrent::BlockTransfer::key_type key);
core::Download* m_download; core::Download* m_download;
unsigned int* m_focus;
assigned_vector m_assigned; assigned_vector m_assigned;
}; };
+9 -3
View File
@@ -202,9 +202,15 @@ main(int argc, char** argv) {
SignalHandler::set_sigaction_handler(SIGBUS, &handle_sigbus); SignalHandler::set_sigaction_handler(SIGBUS, &handle_sigbus);
// SIGUSR1 is used for interrupting polling, forcing that thread // SIGUSR1 is used for interrupting polling, forcing the target
// to process new non-socket events. // thread to process new non-socket events.
SignalHandler::set_handler(SIGUSR1, sigc::ptr_fun(&do_nothing)); //
// 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_NOTICE, "important");
torrent::log_add_group_output(torrent::LOG_INFO, "complete"); torrent::log_add_group_output(torrent::LOG_INFO, "complete");
+3 -3
View File
@@ -169,12 +169,12 @@ SCgi::receive_call(SCgiTask* task, const char* buffer, uint32_t length) {
slot_write slotWrite; slot_write slotWrite;
slotWrite.set(rak::mem_fn(task, &SCgiTask::receive_write)); slotWrite.set(rak::mem_fn(task, &SCgiTask::receive_write));
ThreadBase::acquire_global_lock(); torrent::thread_base::acquire_global_lock();
ThreadBase::interrupt_main_polling(); torrent::main_thread()->interrupt();
bool result = xmlrpc.process(buffer, length, slotWrite); bool result = xmlrpc.process(buffer, length, slotWrite);
ThreadBase::release_global_lock(); torrent::thread_base::release_global_lock();
return result; return result;
} }
+1 -16
View File
@@ -160,20 +160,5 @@ ThreadBase::queue_item(thread_base_func newFunc) {
// Make it also restart inactive threads? // Make it also restart inactive threads?
if (m_state == STATE_ACTIVE) if (m_state == STATE_ACTIVE)
pthread_kill(m_thread, SIGUSR1); interrupt();
}
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);
}
} }
-8
View File
@@ -66,14 +66,6 @@ public:
void queue_item(thread_base_func newFunc); 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: protected:
int64_t next_timeout_usec(); int64_t next_timeout_usec();