Files
Nim/tests/threads/tonthreadcreation.nim
ringabout cdbf5b4699 fixes a severe bug of testament (#20832)
* test azure

* use exit 1

* try again

* use useSysAssert

* disable i386

* use refc for tlsEmulation on i386

* use refc

* disable i386

Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
2022-11-17 09:38:07 +08:00

27 lines
489 B
Nim

discard """
disabled: i386
matrix: "--mm:refc; --mm:orc --deepcopy:on"
output: '''some string here
dying some string here'''
"""
var
someGlobal: string = "some string here"
perThread {.threadvar.}: string
proc threadDied() {.gcsafe.} =
echo "dying ", perThread
proc foo() {.thread.} =
onThreadDestruction threadDied
{.gcsafe.}:
deepCopy(perThread, someGlobal)
echo perThread
proc main =
var t: Thread[void]
createThread[void](t, foo)
t.joinThread()
main()