Skip to content

Commit

Permalink
affinity: do not default to win32
Browse files Browse the repository at this point in the history
  • Loading branch information
tpruvot committed Jul 25, 2015
1 parent ddd5a4e commit f795795
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cpu-miner.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,14 +431,17 @@ static inline void affine_to_cpu(int id, int cpu)
CPU_SET(cpu, &set);
cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TID, -1, sizeof(cpuset_t), &set);
}
#else /* Windows */
#elif defined(WIN32) /* Windows */
static inline void drop_policy(void) { }
static void affine_to_cpu_mask(int id, uint8_t mask) {
if (id == -1)
SetProcessAffinityMask(GetCurrentProcess(), mask);
else
SetThreadAffinityMask(GetCurrentThread(), mask);
}
#else
static inline void drop_policy(void) { }
static void affine_to_cpu_mask(int id, uint8_t mask) { }
#endif

void get_currentalgo(char* buf, int sz)
Expand Down

0 comments on commit f795795

Please sign in to comment.