Skip to content

Commit

Permalink
fix non linux support
Browse files Browse the repository at this point in the history
  • Loading branch information
dterei committed Dec 12, 2014
1 parent e1d3717 commit a742f44
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mutilate.cc
Expand Up @@ -660,7 +660,9 @@ void go(const vector<string>& servers, options_t& options,
vector<string> ts[options.threads];
#endif

#ifdef __linux__
int current_cpu = -1;
#endif

for (int t = 0; t < options.threads; t++) {
td[t].options = &options;
Expand All @@ -683,6 +685,7 @@ void go(const vector<string>& servers, options_t& options,
pthread_attr_t attr;
pthread_attr_init(&attr);

#ifdef __linux__
if (args.affinity_given) {
int max_cpus = 8 * sizeof(cpu_set_t);
cpu_set_t m;
Expand All @@ -704,6 +707,7 @@ void go(const vector<string>& servers, options_t& options,
}
}
}
#endif

if (pthread_create(&pt[t], &attr, thread_main, &td[t]))
DIE("pthread_create() failed");
Expand Down

0 comments on commit a742f44

Please sign in to comment.