summaryrefslogtreecommitdiff
path: root/net-p2p/libtorrent
diff options
context:
space:
mode:
authorAndrej Zverev <az@FreeBSD.org>2012-10-15 12:41:26 +0000
committerAndrej Zverev <az@FreeBSD.org>2012-10-15 12:41:26 +0000
commit4b911a7e05f2e1d7bd2aa705546cd4b095e51c49 (patch)
tree0f87636f71fe137ce5a5a1f85a92409b23c9337f /net-p2p/libtorrent
parentdisable SQLite support for the time being (no child port exists) (diff)
- fix bug causing CPU load on FreeBSD.
- bump portrevisions. PR: ports/170766 Submitted by: Yamagi Burmeister <yamagi@yamagi.org> Approved by: maintainer (timeout > 2 weeks) Feature safe: yes
Notes
Notes: svn path=/head/; revision=305913
Diffstat (limited to 'net-p2p/libtorrent')
-rw-r--r--net-p2p/libtorrent/Makefile1
-rw-r--r--net-p2p/libtorrent/files/patch-src_torrent_utils_thread__base.cc20
2 files changed, 21 insertions, 0 deletions
diff --git a/net-p2p/libtorrent/Makefile b/net-p2p/libtorrent/Makefile
index 7d5eb2a4eca9..1f23ffc54a4e 100644
--- a/net-p2p/libtorrent/Makefile
+++ b/net-p2p/libtorrent/Makefile
@@ -2,6 +2,7 @@
PORTNAME?= libtorrent
PORTVERSION?= 0.13.2
+PORTREVISION= 1
CATEGORIES= net-p2p
MASTER_SITES= http://libtorrent.rakshasa.no/downloads/ \
${MASTER_SITE_LOCAL}
diff --git a/net-p2p/libtorrent/files/patch-src_torrent_utils_thread__base.cc b/net-p2p/libtorrent/files/patch-src_torrent_utils_thread__base.cc
new file mode 100644
index 000000000000..8d17aaab9eb1
--- /dev/null
+++ b/net-p2p/libtorrent/files/patch-src_torrent_utils_thread__base.cc
@@ -0,0 +1,20 @@
+--- src/torrent/utils/thread_base.cc.orig
++++ src/torrent/utils/thread_base.cc
+@@ -88,6 +88,8 @@ thread_base::stop_thread_wait() {
+
+ void
+ thread_base::interrupt() {
++ int sleep_length = 0;
++
+ __sync_fetch_and_or(&m_flags, flag_no_timeout);
+
+ while (is_polling() && has_no_timeout()) {
+@@ -96,7 +98,8 @@ thread_base::interrupt() {
+ if (!(is_polling() && has_no_timeout()))
+ return;
+
+- usleep(0);
++ usleep(sleep_length);
++ sleep_length = std::min(sleep_length + 50, 1000);
+ }
+ } \ No newline at end of file