|
@@ -53,7 +53,7 @@ EConfig CPUCount(U32& TotAvailLogical, U32& TotAvailCore, U32& PhysicalNum)
|
|
#include <string.h>
|
|
#include <string.h>
|
|
#include <sched.h>
|
|
#include <sched.h>
|
|
#define DWORD unsigned long
|
|
#define DWORD unsigned long
|
|
-#elif defined( TORQUE_OS_WIN32 )
|
|
|
|
|
|
+#elif defined( TORQUE_OS_WIN )
|
|
#include <windows.h>
|
|
#include <windows.h>
|
|
#elif defined( TORQUE_OS_MAC )
|
|
#elif defined( TORQUE_OS_MAC )
|
|
# include <sys/types.h>
|
|
# include <sys/types.h>
|
|
@@ -473,7 +473,7 @@ next:
|
|
if ( CPU_ISSET(i, &allowedCPUs) == 0 )
|
|
if ( CPU_ISSET(i, &allowedCPUs) == 0 )
|
|
return CONFIG_UserConfigIssue;
|
|
return CONFIG_UserConfigIssue;
|
|
}
|
|
}
|
|
-#elif defined( TORQUE_OS_WIN32 )
|
|
|
|
|
|
+#elif defined( TORQUE_OS_WIN )
|
|
DWORD dwProcessAffinity, dwSystemAffinity;
|
|
DWORD dwProcessAffinity, dwSystemAffinity;
|
|
GetProcessAffinityMask(GetCurrentProcess(),
|
|
GetProcessAffinityMask(GetCurrentProcess(),
|
|
&dwProcessAffinity,
|
|
&dwProcessAffinity,
|
|
@@ -501,7 +501,7 @@ next:
|
|
if ( sched_setaffinity (0, sizeof(currentCPU), ¤tCPU) == 0 )
|
|
if ( sched_setaffinity (0, sizeof(currentCPU), ¤tCPU) == 0 )
|
|
{
|
|
{
|
|
sleep(0); // Ensure system to switch to the right CPU
|
|
sleep(0); // Ensure system to switch to the right CPU
|
|
-#elif defined( TORQUE_OS_WIN32 )
|
|
|
|
|
|
+#elif defined( TORQUE_OS_WIN )
|
|
while (dwAffinityMask && dwAffinityMask <= dwSystemAffinity)
|
|
while (dwAffinityMask && dwAffinityMask <= dwSystemAffinity)
|
|
{
|
|
{
|
|
if (SetThreadAffinityMask(GetCurrentThread(), dwAffinityMask))
|
|
if (SetThreadAffinityMask(GetCurrentThread(), dwAffinityMask))
|
|
@@ -546,7 +546,7 @@ next:
|
|
#ifdef TORQUE_OS_LINUX
|
|
#ifdef TORQUE_OS_LINUX
|
|
sched_setaffinity (0, sizeof(allowedCPUs), &allowedCPUs);
|
|
sched_setaffinity (0, sizeof(allowedCPUs), &allowedCPUs);
|
|
sleep(0);
|
|
sleep(0);
|
|
-#elif defined( TORQUE_OS_WIN32 )
|
|
|
|
|
|
+#elif defined( TORQUE_OS_WIN )
|
|
SetThreadAffinityMask(GetCurrentThread(), dwProcessAffinity);
|
|
SetThreadAffinityMask(GetCurrentThread(), dwProcessAffinity);
|
|
Sleep(0);
|
|
Sleep(0);
|
|
#else
|
|
#else
|