forked from lix-project/lix
_SC_NPROCESSORS_ONLN -> std:🧵:hardware_concurrency()
This commit is contained in:
parent
4f3fb34844
commit
3fab1f04a7
|
@ -2,9 +2,9 @@
|
||||||
#include "util.hh"
|
#include "util.hh"
|
||||||
#include "archive.hh"
|
#include "archive.hh"
|
||||||
|
|
||||||
#include <map>
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <unistd.h>
|
#include <map>
|
||||||
|
#include <thread>
|
||||||
|
|
||||||
|
|
||||||
namespace nix {
|
namespace nix {
|
||||||
|
@ -42,11 +42,7 @@ Settings::Settings()
|
||||||
keepGoing = false;
|
keepGoing = false;
|
||||||
tryFallback = false;
|
tryFallback = false;
|
||||||
maxBuildJobs = 1;
|
maxBuildJobs = 1;
|
||||||
buildCores = 1;
|
buildCores = std::max(1U, std::thread::hardware_concurrency());
|
||||||
#ifdef _SC_NPROCESSORS_ONLN
|
|
||||||
long res = sysconf(_SC_NPROCESSORS_ONLN);
|
|
||||||
if (res > 0) buildCores = res;
|
|
||||||
#endif
|
|
||||||
readOnlyMode = false;
|
readOnlyMode = false;
|
||||||
thisSystem = SYSTEM;
|
thisSystem = SYSTEM;
|
||||||
maxSilentTime = 0;
|
maxSilentTime = 0;
|
||||||
|
|
Loading…
Reference in a new issue