summary refs log tree commit diff stats
path: root/lib/pure/asyncdispatch.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-01-04 15:59:10 +0100
committerAndreas Rumpf <rumpf_a@web.de>2018-01-04 15:59:10 +0100
commit464d037c1758243664d46595ab4bd800d86e041f (patch)
tree2885cc822fa362f6f5b8603b882feab6e0a02a18 /lib/pure/asyncdispatch.nim
parent2e635ab28cb60be5e63e01ecf074596ccc385696 (diff)
parent2cf94fe7e74afcd48aa8ee19f59231baf56737d6 (diff)
downloadNim-464d037c1758243664d46595ab4bd800d86e041f.tar.gz
Merge branch 'devel' of github.com:nim-lang/Nim into devel
Diffstat (limited to 'lib/pure/asyncdispatch.nim')
-rw-r--r--lib/pure/asyncdispatch.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pure/asyncdispatch.nim b/lib/pure/asyncdispatch.nim
index b62cf2e9b..42ffa236c 100644
--- a/lib/pure/asyncdispatch.nim
+++ b/lib/pure/asyncdispatch.nim
@@ -1487,7 +1487,7 @@ proc drain*(timeout = 500) =
   ## if there are no pending operations. In contrast to ``poll`` this
   ## processes as many events as are available.
   if runOnce(timeout):
-    while runOnce(0): discard
+    while hasPendingOperations() and runOnce(0): discard
 
 proc poll*(timeout = 500) =
   ## Waits for completion events and processes them. Raises ``ValueError``