aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Michael Forney <mforney@mforney.org> 2013-10-26 12:56:46 -0700
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2013-10-26 23:50:59 +0100
commit20324ebe987d3fdccb9c18dfe8b0dbde571241b8 (patch)
tree76e5613192bc1aec032c1b8dcc178210357cce79
parent8eb0e5d05aef244455547637479f4790b8715db5 (diff)
downloadpaludis-20324ebe987d3fdccb9c18dfe8b0dbde571241b8.tar.gz
paludis-20324ebe987d3fdccb9c18dfe8b0dbde571241b8.tar.xz
Use std::thread::hardware_concurrency instead of get_nprocs
-rw-r--r--src/clients/cave/cmd_generate_metadata.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/clients/cave/cmd_generate_metadata.cc b/src/clients/cave/cmd_generate_metadata.cc
index b33813a..b3425f8 100644
--- a/src/clients/cave/cmd_generate_metadata.cc
+++ b/src/clients/cave/cmd_generate_metadata.cc
@@ -41,12 +41,12 @@
#include <paludis/metadata_key.hh>
#include <paludis/notifier_callback.hh>
#include <paludis/slot.hh>
-#include <sys/sysinfo.h>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <mutex>
#include <map>
+#include <thread>
#include <unistd.h>
#include "command_command_line.hh"
@@ -307,8 +307,8 @@ GenerateMetadataCommand::run(
ScopedNotifierCallback display_callback_holder(env.get(), NotifierCallbackFunction(std::cref(callback)));
ThreadPool pool;
- int n_procs(get_nprocs());
- if (n_procs < 1)
+ unsigned n_procs(std::thread::hardware_concurrency());
+ if (n_procs == 0)
n_procs = 1;
for (int n(0), n_end(n_procs) ; n != n_end ; ++n)