summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2017-01-07 10:39:20 +0100
committerAndreas Rumpf <rumpf_a@web.de>2017-01-07 13:27:16 +0100
commita93ca14418ee91864bb9a3f8888b5e9a823f94f3 (patch)
tree6805e76926dc5e88213b598ce2c1b1d6b889d6fc /lib
parent5ce414141ed2141591006da4b0261d51d9be32d6 (diff)
downloadNim-a93ca14418ee91864bb9a3f8888b5e9a823f94f3.tar.gz
disable pinToCpu for OSX
Diffstat (limited to 'lib')
-rw-r--r--lib/system/threads.nim9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/system/threads.nim b/lib/system/threads.nim
index 6f5bb38b1..e32b77258 100644
--- a/lib/system/threads.nim
+++ b/lib/system/threads.nim
@@ -463,10 +463,11 @@ else:
     ## pins a thread to a `CPU`:idx:. In other words sets a
     ## thread's `affinity`:idx:. If you don't know what this means, you
     ## shouldn't use this proc.
-    var s {.noinit.}: CpuSet
-    cpusetZero(s)
-    cpusetIncl(cpu.cint, s)
-    setAffinity(t.sys, sizeof(s), s)
+    when not defined(macosx):
+      var s {.noinit.}: CpuSet
+      cpusetZero(s)
+      cpusetIncl(cpu.cint, s)
+      setAffinity(t.sys, sizeof(s), s)
 
 proc createThread*(t: var Thread[void], tp: proc () {.thread, nimcall.}) =
   createThread[void](t, tp)