mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 08:54:53 +00:00
* 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>
27 lines
478 B
Nim
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"
|