diff --git a/lib/system/yrc.nim b/lib/system/yrc.nim index 9f82c68252..58e26afef2 100644 --- a/lib/system/yrc.nim +++ b/lib/system/yrc.nim @@ -56,11 +56,12 @@ include threadids type Stripe = object - lock: Lock - toInc: array[QueueSize, Cell] + lockInc: Lock toIncLen: int - toDec: array[QueueSize, (Cell, PNimTypeV2)] + toInc: array[QueueSize, Cell] + lockDec: Lock toDecLen: int + toDec: array[QueueSize, (Cell, PNimTypeV2)] var gYrcGlobalLock: Lock @@ -79,7 +80,7 @@ proc nimIncRefCyclic(p: pointer; cyclic: bool) {.compilerRtl, inl.} = let idx = getStripeIdx() while true: var overflow = false - withLock stripes[idx].lock: + withLock stripes[idx].lockInc: if stripes[idx].toIncLen < QueueSize: stripes[idx].toInc[stripes[idx].toIncLen] = h stripes[idx].toIncLen += 1 @@ -88,19 +89,22 @@ proc nimIncRefCyclic(p: pointer; cyclic: bool) {.compilerRtl, inl.} = if overflow: withLock gYrcGlobalLock: for i in 0..