summary refs log tree commit diff stats
path: root/tests/stdlib/tthreadpool.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stdlib/tthreadpool.nim')
-rw-r--r--tests/stdlib/tthreadpool.nim14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/stdlib/tthreadpool.nim b/tests/stdlib/tthreadpool.nim
new file mode 100644
index 000000000..1947074be
--- /dev/null
+++ b/tests/stdlib/tthreadpool.nim
@@ -0,0 +1,14 @@
+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
2dd3a1c1'>^
ee9a9237 ^


e5cbbea4 ^
ee9a9237 ^
6030d7e2 ^
9d27e966 ^

dd9ba09a ^
9d27e966 ^
dd9ba09a ^
ee9a9237 ^
6030d7e2 ^
ee9a9237 ^
6030d7e2 ^
9d27e966 ^
6030d7e2 ^


d9818a53 ^
03d50cc8 ^
6030d7e2 ^








ed0e64a9 ^
ee9a9237 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52