bugfix: fixed memory leaks in osproc module
This commit is contained in:
parent
c9b67f724d
commit
a497b4d1cf
7 changed files with 185 additions and 127 deletions
13
tests/threads/tactors.nim
Normal file
13
tests/threads/tactors.nim
Normal file
|
|
@ -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()
|
||||
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
discard """
|
||||
file: "tthreadanalysis2.nim"
|
||||
line: 45
|
||||
line: 42
|
||||
errormsg: "write to foreign heap"
|
||||
cmd: "nimrod cc --hints:on --threads:on $# $#"
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue