Closed
Description
The following code works with default gc, but will crash after the first iteration when using --gc:arc
Example
import os
proc threadFunc(i:int ) {.thread.} =
echo("Performing...")
os.sleep(100)
when isMainModule:
while true:
echo("Starting...")
var thr: array[0..3, Thread[int]]
for i in 0..high(thr):
createThread(thr[i], threadFunc, i)
joinThreads(thr)
echo("Done...")
Current Output
Crash after first iteration
Expected Output
Perform next iteration
$ nim -v
Nim Compiler Version 1.2.0 [Windows: amd64]
(Tried on Linux too)
Activity