mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-04 12:07:51 +00:00
@@ -55,3 +55,11 @@ block t9442:
|
||||
GC_unref(v2)
|
||||
GC_ref(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()
|
||||
Reference in New Issue
Block a user