diff options
-rw-r--r-- | Platform.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Platform.cpp b/Platform.cpp index dff36cb..bed3aa1 100644 --- a/Platform.cpp +++ b/Platform.cpp @@ -21,8 +21,20 @@ void SetAffinity ( int cpu ) #else
+#include <sched.h>
+
void SetAffinity ( int /*cpu*/ )
{
+ cpu_set_t mask;
+
+ CPU_ZERO(&mask);
+
+ CPU_SET(2,&mask);
+
+ if( sched_setaffinity(0,sizeof(mask),&mask) == -1)
+ {
+ printf("WARNING: Could not set CPU affinity\n");
+ }
}
#endif
|