mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-07 21:43:33 +00:00
* fixes the regressions * closes #13936 * scope based memory management implemented * enabled tcontrolflow.nim test case * final cleanups
25 lines
503 B
Nim
25 lines
503 B
Nim
discard """
|
|
output: '''
|
|
hasPendingOperations: false
|
|
triggerCount: 100
|
|
'''
|
|
disabled: "windows"
|
|
"""
|
|
|
|
import asyncDispatch
|
|
|
|
var triggerCount = 0
|
|
var evs = newSeq[AsyncEvent]()
|
|
|
|
for i in 0 ..< 100: # has to be lower than the typical physical fd limit
|
|
var ev = newAsyncEvent()
|
|
evs.add(ev)
|
|
addEvent(ev, proc(fd: AsyncFD): bool {.gcsafe,closure.} = triggerCount += 1; true)
|
|
|
|
for ev in evs:
|
|
ev.trigger()
|
|
|
|
drain()
|
|
echo "hasPendingOperations: ", hasPendingOperations()
|
|
echo "triggerCount: ", triggerCount
|