diff options
author | Araq <rumpf_a@web.de> | 2011-11-18 22:14:32 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-11-18 22:14:32 +0100 |
commit | a497b4d1cf529b24ac469e701cb60e8d8b5fdefc (patch) | |
tree | 867eb30d869f96ab3bec0908f62e1f26bc187a82 /tests/threads | |
parent | c9b67f724d039437ea72f666018d2a80266b8a2b (diff) | |
download | Nim-a497b4d1cf529b24ac469e701cb60e8d8b5fdefc.tar.gz |
bugfix: fixed memory leaks in osproc module
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 $# $#" """ |