diff --git a/asyncdispatch2.nimble b/asyncdispatch2.nimble index d1a5fd0..f6566be 100644 --- a/asyncdispatch2.nimble +++ b/asyncdispatch2.nimble @@ -33,3 +33,7 @@ task test, "Run all tests": exec "nim c -r -d:useSysAssert -d:useGcAssert tests/teststream" exec "nim c -r tests/teststream" exec "nim c -r -d:release tests/teststream" + + exec "nim c -r -d:useSysAssert -d:useGcAssert tests/teststream2" + exec "nim c -r tests/teststream2" + exec "nim c -r -d:release tests/teststream2" diff --git a/asyncdispatch2/asyncloop.nim b/asyncdispatch2/asyncloop.nim index 16c13e9..4d43e3d 100644 --- a/asyncdispatch2/asyncloop.nim +++ b/asyncdispatch2/asyncloop.nim @@ -278,6 +278,9 @@ when defined(windows) or defined(nimdoc): if curTimeout == 0: if len(loop.callbacks) == 0: curTimeout = INFINITE + else: + if len(loop.callbacks) != 0: + curTimeout = 0 # Processing handles var lpNumberOfBytesTransferred: Dword @@ -519,6 +522,9 @@ else: if curTimeout == 0: if len(loop.callbacks) == 0: curTimeout = -1 + else: + if len(loop.callbacks) != 0: + curTimeout = 0 count = loop.selector.selectInto(curTimeout, loop.keys) for i in 0..