Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ringabout committed Jul 21, 2021
1 parent e38388e commit f67cd8a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/magics/tmagics.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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)
30 changes: 30 additions & 0 deletions tests/threads/t7172.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
discard """
output: '''
In doStuff()
In initProcess()
initProcess() done
TEST
Crashes before getting here!
'''
"""

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")

proc doStuff(): void =
echo("In doStuff()")
# ...
initProcess()
sleep(500)
# ...
echo("Crashes before getting here!")

doStuff()

0 comments on commit f67cd8a

Please sign in to comment.