aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-08-28 16:23:11 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-08-28 16:23:11 +0000
commit7ad1815b32e5f117d02f2738a2a991428054e5a9 (patch)
treec681f18254015f7624b9af98702678621262c85b
parent7c80ae93eb06f7152c3485503cfaa7675fc8f8e0 (diff)
downloadpaludis-7ad1815b32e5f117d02f2738a2a991428054e5a9.tar.gz
paludis-7ad1815b32e5f117d02f2738a2a991428054e5a9.tar.xz
Clean up non-threaded code
-rw-r--r--paludis/util/action_queue.cc7
-rw-r--r--paludis/util/idle_action_pool.cc4
-rw-r--r--paludis/util/parallel_for_each.hh7
-rw-r--r--paludis/util/system_TEST.cc8
4 files changed, 23 insertions, 3 deletions
diff --git a/paludis/util/action_queue.cc b/paludis/util/action_queue.cc
index 551dafd..1898a67 100644
--- a/paludis/util/action_queue.cc
+++ b/paludis/util/action_queue.cc
@@ -89,14 +89,17 @@ namespace paludis
};
}
-ActionQueue::ActionQueue(const unsigned n_threads, const bool nice) :
#ifdef PALUDIS_ENABLE_THREADS
+ActionQueue::ActionQueue(const unsigned n_threads, const bool nice) :
PrivateImplementationPattern<ActionQueue>(new Implementation<ActionQueue>(n_threads, nice))
+{
+}
#else
+ActionQueue::ActionQueue(const unsigned, const bool) :
PrivateImplementationPattern<ActionQueue>(new Implementation<ActionQueue>())
-#endif
{
}
+#endif
ActionQueue::~ActionQueue()
{
diff --git a/paludis/util/idle_action_pool.cc b/paludis/util/idle_action_pool.cc
index 5200760..4478eff 100644
--- a/paludis/util/idle_action_pool.cc
+++ b/paludis/util/idle_action_pool.cc
@@ -122,7 +122,11 @@ IdleActionPool::optional_idle_action(
}
void
+#ifdef PALUDIS_ENABLE_THREADS
IdleActionPool::_count_result(const tr1::function<IdleActionResult () throw ()> & f)
+#else
+IdleActionPool::_count_result(const tr1::function<IdleActionResult () throw ()> &)
+#endif
{
#ifdef PALUDIS_ENABLE_THREADS
{
diff --git a/paludis/util/parallel_for_each.hh b/paludis/util/parallel_for_each.hh
index 10541c7..980b42d 100644
--- a/paludis/util/parallel_for_each.hh
+++ b/paludis/util/parallel_for_each.hh
@@ -70,7 +70,12 @@ namespace paludis
template <typename I_, typename P_>
void parallel_for_each(I_ cur, const I_ & end, const P_ & op,
- const unsigned partition_size = FutureActionQueue::get_instance()->number_of_threads())
+#ifdef PALUDIS_ENABLE_THREADS
+ const unsigned partition_size = FutureActionQueue::get_instance()->number_of_threads()
+#else
+ const unsigned = 0
+#endif
+ )
{
#ifdef PALUDIS_ENABLE_THREADS
Sequence<tr1::shared_ptr<Future<void> > > futures;
diff --git a/paludis/util/system_TEST.cc b/paludis/util/system_TEST.cc
index d9a3eba..5d0d6d0 100644
--- a/paludis/util/system_TEST.cc
+++ b/paludis/util/system_TEST.cc
@@ -40,7 +40,11 @@ using namespace paludis;
namespace
{
+#ifdef PALUDIS_ENABLE_THREADS
void repeatedly_log(bool & b)
+#else
+ void repeatedly_log(bool &)
+#endif
{
#ifdef PALUDIS_ENABLE_THREADS
while (! b)
@@ -51,7 +55,11 @@ namespace
Log::get_instance()->message(ll_debug, lc_context) << "logging stuff";
}
+#ifdef PALUDIS_ENABLE_THREADS
void repeatedly_run_command(bool & b)
+#else
+ void repeatedly_run_command(bool &)
+#endif
{
#ifdef PALUDIS_ENABLE_THREADS
while (! b)