Files
Nim/tests/threads/tracy_allocator.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
478 B
Nim

discard """
disabled: i386
output: '''true'''
"""
var somethingElse {.threadvar.}: ref string
type MyThread = Thread[void]
proc asyncThread() {.thread.} =
new somethingElse
var threads = newSeq[ptr Thread[void]](8)
for c in 1..1_000:
#echo "Test " & $c
for i in 0..<threads.len:
var t = cast[ptr Thread[void]](alloc0(sizeof(MyThread)))
threads[i] = t
createThread(t[], asyncThread)
for t in threads:
joinThread(t[])
dealloc(t)
echo "true"