diff options
Diffstat (limited to 'tests/threads')
-rw-r--r-- | tests/threads/tactors.nim | 13 | ||||
-rwxr-xr-x | tests/threads/threadex.nim | 5 | ||||
-rwxr-xr-x | tests/threads/tthreadanalysis2.nim | 2 |
3 files changed, 18 insertions, 2 deletions
diff --git a/tests/threads/tactors.nim b/tests/threads/tactors.nim new file mode 100644 index 000000000..d6297d6bc --- /dev/null +++ b/tests/threads/tactors.nim @@ -0,0 +1,13 @@ +discard """ + outputsub: "150" +""" + +import actors + +var + a: TActorPool[int, void] +createActorPool(a) +for i in 0 .. < 300: + a.spawn(i, proc (x: int) {.thread.} = echo x) +a.join() + diff --git a/tests/threads/threadex.nim b/tests/threads/threadex.nim index d8b4a94fb..5b8055413 100755 --- a/tests/threads/threadex.nim +++ b/tests/threads/threadex.nim @@ -1,3 +1,6 @@ +discard """ + output: "" +""" type TMsgKind = enum @@ -18,7 +21,7 @@ proc consume() {.thread.} = x.backTo.send(printedLines) break echo x.data - discard atomicInc(printedLines) + atomicInc(printedLines) proc produce() = var m: TMsg diff --git a/tests/threads/tthreadanalysis2.nim b/tests/threads/tthreadanalysis2.nim index 95f39723f..bc071b478 100755 --- a/tests/threads/tthreadanalysis2.nim +++ b/tests/threads/tthreadanalysis2.nim @@ -1,6 +1,6 @@ discard """ file: "tthreadanalysis2.nim" - line: 45 + line: 42 errormsg: "write to foreign heap" cmd: "nimrod cc --hints:on --threads:on $# $#" """ |