mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-03 11:42:33 +00:00
30 lines
366 B
Nim
30 lines
366 B
Nim
discard """
|
|
output: '''0
|
|
hello'''
|
|
"""
|
|
|
|
type
|
|
CircAlloc*[Size: static[int], T] = tuple
|
|
baseArray: array[Size,T]
|
|
index: uint16
|
|
|
|
type
|
|
Job = object of RootObj
|
|
|
|
var foo {.threadvar.}: CircAlloc[1, Job]
|
|
|
|
when true:
|
|
echo foo.index
|
|
|
|
|
|
# bug #10795
|
|
import asyncdispatch
|
|
import threadpool
|
|
|
|
proc f1() =
|
|
waitFor sleepAsync(100)
|
|
echo "hello"
|
|
|
|
spawn f1()
|
|
sync()
|