summary refs log tree commit diff stats
path: root/lib/system/gc.nim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/system/gc.nim')
-rwxr-xr-xlib/system/gc.nim10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/system/gc.nim b/lib/system/gc.nim
index 72ae84096..c5bd56b99 100755
--- a/lib/system/gc.nim
+++ b/lib/system/gc.nim
@@ -61,8 +61,9 @@ type
     decStack: TCellSeq       # cells in the stack that are to decref again
     cycleRoots: TCellSet
     tempStack: TCellSeq      # temporary stack for recursion elimination
-    cycleRootsLock: TSysLock
-    zctLock: TSysLock
+    when hasThreadSupport:
+      cycleRootsLock: TSysLock
+      zctLock: TSysLock
     stat: TGcStat
 
 var
@@ -281,8 +282,9 @@ proc initGC() =
     init(gch.tempStack)
     Init(gch.cycleRoots)
     Init(gch.decStack)
-    InitLock(gch.cycleRootsLock)
-    InitLock(gch.zctLock)
+    when hasThreadSupport:
+      InitLock(gch.cycleRootsLock)
+      InitLock(gch.zctLock)
     new(gOutOfMem) # reserve space for the EOutOfMemory exception here!
 
 proc forAllSlotsAux(dest: pointer, n: ptr TNimNode, op: TWalkOp) =