Files
Nim/tests/stdlib/tthreadpool.nim
ringabout 4fa86422c0 stdlib tests now check refc too (#21664)
* stdlib tests now check refc too

* typo

* fixes line numbers

* disable cpp

* do not touch
2023-04-21 15:37:58 +02:00

15 lines
380 B
Nim

discard """
matrix: "--mm:arc; --mm:refc"
disabled: "freebsd"
output: "42"
"""
import std/assertions
from std/threadpool import spawn, `^`, sync
block: # bug #12005
proc doworkok(i: int) {.thread.} = echo i
spawn(doworkok(42))
sync() # this works when returning void!
proc doworkbad(i: int): int {.thread.} = i
doAssert ^spawn(doworkbad(42)) == 42 # bug was here