From cd5b67ad7f9792eebeaa2a2d52c8853738857258 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 2 Mar 2020 17:07:07 +0300 Subject: [PATCH] Fixed build on Mac OS X --- dbms/src/Common/ThreadFuzzer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dbms/src/Common/ThreadFuzzer.cpp b/dbms/src/Common/ThreadFuzzer.cpp index 453b57bcefc..a0bf6cb95c6 100644 --- a/dbms/src/Common/ThreadFuzzer.cpp +++ b/dbms/src/Common/ThreadFuzzer.cpp @@ -52,6 +52,8 @@ void ThreadFuzzer::initConfiguration() { #if OS_LINUX num_cpus = get_nprocs(); +#else + (void)num_cpus; #endif initFromEnv(cpu_time_period_us, "THREAD_FUZZER_CPU_TIME_PERIOD_US"); @@ -75,6 +77,7 @@ void ThreadFuzzer::signalHandler(int) sched_yield(); } +#if OS_LINUX if (fuzzer.num_cpus > 0 && fuzzer.migrate_probability > 0 && std::bernoulli_distribution(fuzzer.migrate_probability)(thread_local_rng)) @@ -87,6 +90,7 @@ void ThreadFuzzer::signalHandler(int) (void)sched_setaffinity(0, sizeof(set), &set); } +#endif if (fuzzer.sleep_probability > 0 && fuzzer.chaos_sleep_time_us > 0