Переглянути джерело

Merge pull request #6980 from richardkchapman/osx2

HPCC-13055 OSX support

Reviewed By: Gordon Smith <gordon.smith@lexisnexis.com>
Reviewed By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 10 роки тому
батько
коміт
2d813dca03
1 змінених файлів з 5 додано та 5 видалено
  1. 5 5
      roxie/ccd/ccdlistener.cpp

+ 5 - 5
roxie/ccd/ccdlistener.cpp

@@ -729,7 +729,7 @@ public:
 
 
     static void updateAffinity()
     static void updateAffinity()
     {
     {
-#ifndef _WIN32
+#ifdef CPU_ZERO
         if (sched_getaffinity(0, sizeof(cpu_set_t), &cpuMask))
         if (sched_getaffinity(0, sizeof(cpu_set_t), &cpuMask))
         {
         {
             if (traceLevel)
             if (traceLevel)
@@ -836,7 +836,7 @@ public:
 
 
     void setThreadAffinity(int numCores)
     void setThreadAffinity(int numCores)
     {
     {
-#ifndef _WIN32
+#ifdef CPU_ZERO
         // Note - strictly speaking not threadsafe but any race conditions are (a) unlikely and (b) harmless
         // Note - strictly speaking not threadsafe but any race conditions are (a) unlikely and (b) harmless
         if (cpuCores)
         if (cpuCores)
         {
         {
@@ -887,7 +887,7 @@ protected:
     CriticalSection activeCrit;
     CriticalSection activeCrit;
     friend class ActiveQueryLimiter;
     friend class ActiveQueryLimiter;
 
 
-#ifndef _WIN32
+#ifdef CPU_ZERO
     static cpu_set_t cpuMask;
     static cpu_set_t cpuMask;
     static unsigned cpuCores;
     static unsigned cpuCores;
     static unsigned lastCore;
     static unsigned lastCore;
@@ -909,7 +909,7 @@ private:
     CIArrayOf<AccessTableEntry> accessTable;
     CIArrayOf<AccessTableEntry> accessTable;
 };
 };
 
 
-#ifndef _WIN32
+#ifdef CPU_ZERO
 cpu_set_t RoxieListener::cpuMask;
 cpu_set_t RoxieListener::cpuMask;
 unsigned RoxieListener::cpuCores;
 unsigned RoxieListener::cpuCores;
 unsigned RoxieListener::lastCore;
 unsigned RoxieListener::lastCore;
@@ -919,7 +919,7 @@ extern void updateAffinity(unsigned __int64 affinity)
 {
 {
     if (affinity)  // 0 means use the value already set for this process
     if (affinity)  // 0 means use the value already set for this process
     {
     {
-#ifdef _WIN32
+#ifndef CPU_ZERO
         throw makeStringException(ROXIE_INTERNAL_ERROR, "Setting Roxie affinity is not supported on this operating system");
         throw makeStringException(ROXIE_INTERNAL_ERROR, "Setting Roxie affinity is not supported on this operating system");
 #else
 #else
         cpu_set_t cpus;
         cpu_set_t cpus;