Skip to content

Commit

Permalink
Fix compile for Windows issue
Browse files Browse the repository at this point in the history
  • Loading branch information
macchky committed Jan 26, 2018
1 parent b304ea2 commit 712699a
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions cpu-miner.c
Expand Up @@ -41,21 +41,6 @@
#define PROGRAM_NAME "minerd"
#define LP_SCANTIME 60

#ifdef __linux /* Linux specific policy and affinity management */
#include <sched.h>
static inline void drop_policy(void)
{
struct sched_param param;
param.sched_priority = 0;

#ifdef SCHED_IDLE
if (unlikely(sched_setscheduler(0, SCHED_IDLE, &param) == -1))
#endif
#ifdef SCHED_BATCH
sched_setscheduler(0, SCHED_BATCH, &param);
#endif
}

enum workio_commands {
WC_GET_WORK,
WC_SUBMIT_WORK,
Expand Down Expand Up @@ -249,6 +234,21 @@ static pthread_mutex_t g_work_lock;
static bool submit_old = false;
static char *lp_id;

#ifdef __linux /* Linux specific policy and affinity management */
#include <sched.h>
static inline void drop_policy(void)
{
struct sched_param param;
param.sched_priority = 0;

#ifdef SCHED_IDLE
if (unlikely(sched_setscheduler(0, SCHED_IDLE, &param) == -1))
#endif
#ifdef SCHED_BATCH
sched_setscheduler(0, SCHED_BATCH, &param);
#endif
}

#ifdef __BIONIC__
#define pthread_setaffinity_np(tid,sz,s) {} /* only do process affinity */
#endif
Expand Down

0 comments on commit 712699a

Please sign in to comment.