aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2007-10-15 13:00:42 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2007-10-15 13:00:42 +0000
commitc0eb0916679147f683da34dc26c643a491366a56 (patch)
tree1273f16a9278572534d92ccd0b56588419d78ad2
parent20dde20c875bce797a6b47a1e543822aab6ffabc (diff)
downloadpaludis-c0eb0916679147f683da34dc26c643a491366a56.tar.gz
paludis-c0eb0916679147f683da34dc26c643a491366a56.tar.xz
Don't limit the queue size for Log.
-rw-r--r--paludis/util/action_queue.cc10
-rw-r--r--paludis/util/action_queue.hh2
-rw-r--r--paludis/util/log.cc3
3 files changed, 9 insertions, 6 deletions
diff --git a/paludis/util/action_queue.cc b/paludis/util/action_queue.cc
index 1898a67..3ca7258 100644
--- a/paludis/util/action_queue.cc
+++ b/paludis/util/action_queue.cc
@@ -41,6 +41,7 @@ namespace paludis
bool should_finish;
std::deque<tr1::function<void () throw ()> > queue;
ThreadPool threads;
+ bool limit_size;
void finish()
{
@@ -75,7 +76,8 @@ namespace paludis
}
}
- Implementation(const unsigned n_threads, const bool nice) :
+ Implementation(const unsigned n_threads, const bool nice, const bool do_limit_size) :
+ limit_size(do_limit_size),
should_finish(false)
{
for (unsigned x(0) ; x < n_threads ; ++x)
@@ -90,8 +92,8 @@ namespace paludis
}
#ifdef PALUDIS_ENABLE_THREADS
-ActionQueue::ActionQueue(const unsigned n_threads, const bool nice) :
- PrivateImplementationPattern<ActionQueue>(new Implementation<ActionQueue>(n_threads, nice))
+ActionQueue::ActionQueue(const unsigned n_threads, const bool nice, const bool limit_size) :
+ PrivateImplementationPattern<ActionQueue>(new Implementation<ActionQueue>(n_threads, nice, limit_size))
{
}
#else
@@ -113,7 +115,7 @@ ActionQueue::enqueue(const tr1::function<void () throw ()> & f)
{
#ifdef PALUDIS_ENABLE_THREADS
Lock l(_imp->mutex);
- if (_imp->queue.size() < 1000)
+ if ((! _imp->limit_size) || (_imp->queue.size() < 1000))
{
_imp->queue.push_back(f);
_imp->condition.signal();
diff --git a/paludis/util/action_queue.hh b/paludis/util/action_queue.hh
index 0593d56..c66e80d 100644
--- a/paludis/util/action_queue.hh
+++ b/paludis/util/action_queue.hh
@@ -42,7 +42,7 @@ namespace paludis
///\name Basic operations
///\{
- ActionQueue(const unsigned n_threads = 1, const bool nice = false);
+ ActionQueue(const unsigned n_threads = 1, const bool nice = false, const bool limit_size = true);
~ActionQueue();
///\}
diff --git a/paludis/util/log.cc b/paludis/util/log.cc
index f35fcc3..cfc84e3 100644
--- a/paludis/util/log.cc
+++ b/paludis/util/log.cc
@@ -56,7 +56,8 @@ namespace paludis
Implementation() :
log_level(initial_ll),
stream(&std::cerr),
- program_name("paludis")
+ program_name("paludis"),
+ action_queue(1, false, false)
{
}