Fix and reenable thread tests (#11343)

This commit is contained in:
Zed 2019-05-28 15:23:09 +02:00 • committed by Andreas Rumpf
commit 1f8c9aff1f
2 changed files with 5 additions and 8 deletions

View file

@ -1,8 +1,6 @@
discard """ discard """
disabled: yes
outputsub: "101"
errormsg: "'threadFunc' is not GC-safe" errormsg: "'threadFunc' is not GC-safe"
line: 39 line: 38
cmd: "nim $target --hints:on --threads:on $options $file" cmd: "nim $target --hints:on --threads:on $options $file"
""" """
@ -15,7 +13,7 @@ proc doNothing() = discard
type type
PNode = ref TNode PNode = ref TNode
TNode = object {.pure.} TNode {.pure.} = object
le, ri: PNode le, ri: PNode
data: string data: string

View file

@ -1,18 +1,17 @@
discard """ discard """
disabled: yes
outputsub: "channel is empty" outputsub: "channel is empty"
""" """
# bug #1816 # bug #1816
from random import random from random import rand
from os import sleep from os import sleep
type PComm = ptr Channel[int] type PComm = ptr Channel[int]
proc doAction(outC: PComm) {.thread.} = proc doAction(outC: PComm) {.thread.} =
for i in 0.. <5: for i in 0 ..< 5:
sleep(random(100)) sleep(rand(100))
send(outC[], i) send(outC[], i)
var var