aboutsummaryrefslogtreecommitdiffstats
path: root/net-p2p
diff options
context:
space:
mode:
authorflz <flz@FreeBSD.org>2012-01-29 19:26:25 +0800
committerflz <flz@FreeBSD.org>2012-01-29 19:26:25 +0800
commitdfaeba588303152a6f98dad4b4cd9d1b02877266 (patch)
tree9904431c1ec5fa0e5b9d7ac4649592852913b33a /net-p2p
parent120f02e2f1159b478d5df3aecc20707d8707f44d (diff)
downloadfreebsd-ports-gnome-dfaeba588303152a6f98dad4b4cd9d1b02877266.tar.gz
freebsd-ports-gnome-dfaeba588303152a6f98dad4b4cd9d1b02877266.tar.zst
freebsd-ports-gnome-dfaeba588303152a6f98dad4b4cd9d1b02877266.zip
- Backport upstream patch to fix high cpu load issues.
Submitted by: Nicholas Smith Obtained from: http://libtorrent.rakshasa.no/ticket/2661
Diffstat (limited to 'net-p2p')
-rw-r--r--net-p2p/rtorrent/Makefile2
-rw-r--r--net-p2p/rtorrent/files/patch-src_thread_base.cc26
2 files changed, 27 insertions, 1 deletions
diff --git a/net-p2p/rtorrent/Makefile b/net-p2p/rtorrent/Makefile
index f39f8ff30add..ebc34a81ed11 100644
--- a/net-p2p/rtorrent/Makefile
+++ b/net-p2p/rtorrent/Makefile
@@ -7,7 +7,7 @@
PORTNAME?= rtorrent
PORTVERSION?= 0.8.9
-PORTREVISION?= 0
+PORTREVISION?= 1
CATEGORIES= net-p2p
MASTER_SITES= http://libtorrent.rakshasa.no/downloads/ \
${MASTER_SITE_LOCAL}
diff --git a/net-p2p/rtorrent/files/patch-src_thread_base.cc b/net-p2p/rtorrent/files/patch-src_thread_base.cc
index 0a84dda1069d..d13727326024 100644
--- a/net-p2p/rtorrent/files/patch-src_thread_base.cc
+++ b/net-p2p/rtorrent/files/patch-src_thread_base.cc
@@ -1,5 +1,11 @@
--- src/thread_base.cc.orig 2011-04-05 11:26:11.000000000 +0100
+++ src/thread_base.cc 2011-06-09 18:59:41.375670521 +0100
+@@ -44,4 +44,5 @@
+ #include <iostream>
+ #include <signal.h>
++#include <unistd.h>
+ #include <rak/error_number.h>
+ #include <torrent/exceptions.h>
@@ -61,7 +61,7 @@
static const unsigned int max_size = 32;
@@ -9,3 +15,23 @@
void lock() { while (!__sync_bool_compare_and_swap(&m_lock, 0, 1)) usleep(0); }
void unlock() { __sync_bool_compare_and_swap(&m_lock, 1, 0); }
+@@ -202,9 +203,14 @@
+ void
+ ThreadBase::interrupt_main_polling() {
+- do {
++ int sleep_length = 0;
++
++ while (ThreadBase::is_main_polling()) {
++ pthread_kill(main_thread->m_thread, SIGUSR1);
++
+ if (!ThreadBase::is_main_polling())
+ return;
+-
+- pthread_kill(main_thread->m_thread, SIGUSR1);
+- } while (1);
+-}
++
++ usleep(sleep_length);
++ sleep_length = std::min(sleep_length + 50, 1000);
++ }
++}