parent
9c2442af94
commit
f048dad7c3
2 changed files with 40 additions and 0 deletions
|
|
@ -55,3 +55,11 @@ block t9442:
|
||||||
GC_unref(v2)
|
GC_unref(v2)
|
||||||
GC_ref(v3)
|
GC_ref(v3)
|
||||||
GC_unref(v3)
|
GC_unref(v3)
|
||||||
|
|
||||||
|
block: # bug #6499
|
||||||
|
let x = (chr, 0)
|
||||||
|
doAssert x[1] == 0
|
||||||
|
|
||||||
|
block: # bug #12229
|
||||||
|
proc foo(T: typedesc) = discard
|
||||||
|
foo(ref)
|
||||||
|
|
|
||||||
32
tests/threads/t7172.nim
Normal file
32
tests/threads/t7172.nim
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
discard """
|
||||||
|
output: '''
|
||||||
|
In doStuff()
|
||||||
|
In initProcess()
|
||||||
|
initProcess() done
|
||||||
|
TEST
|
||||||
|
Crashes before getting here!
|
||||||
|
'''
|
||||||
|
joinable: false
|
||||||
|
"""
|
||||||
|
|
||||||
|
import std/os
|
||||||
|
|
||||||
|
proc whatever() {.thread, nimcall.} =
|
||||||
|
echo("TEST")
|
||||||
|
|
||||||
|
proc initProcess(): void =
|
||||||
|
echo("In initProcess()")
|
||||||
|
var thread: Thread[void]
|
||||||
|
createThread(thread, whatever)
|
||||||
|
echo("initProcess() done")
|
||||||
|
joinThread(thread)
|
||||||
|
|
||||||
|
proc doStuff(): void =
|
||||||
|
echo("In doStuff()")
|
||||||
|
# ...
|
||||||
|
initProcess()
|
||||||
|
sleep(500)
|
||||||
|
# ...
|
||||||
|
echo("Crashes before getting here!")
|
||||||
|
|
||||||
|
doStuff()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue