Files
Nim/tests/stdlib/tthreadpool.nim
ringabout 3d2f0e2c7c make more standard libraries work with nimPreviewSlimSystem (#20343)
* make more standard libraries work with `nimPreviewSlimSystem`

* typo

* part two

* Delete specutils.nim

* fixes more tests

* more fixes

* fixes tests

* fixes three more tests

* add formatfloat import

* fix

* last
2022-09-27 20:06:23 +02:00

15 lines
382 B
Nim

discard """
matrix: "--threads:on --gc:arc"
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