From 4b911a7e05f2e1d7bd2aa705546cd4b095e51c49 Mon Sep 17 00:00:00 2001 From: Andrej Zverev Date: Mon, 15 Oct 2012 12:41:26 +0000 Subject: - fix bug causing CPU load on FreeBSD. - bump portrevisions. PR: ports/170766 Submitted by: Yamagi Burmeister Approved by: maintainer (timeout > 2 weeks) Feature safe: yes --- net-p2p/libtorrent/Makefile | 1 + .../files/patch-src_torrent_utils_thread__base.cc | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 net-p2p/libtorrent/files/patch-src_torrent_utils_thread__base.cc (limited to 'net-p2p/libtorrent') 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 -- cgit v1.2.3