diff options
author | cheatfate <ka@hardcore.kiev.ua> | 2016-11-30 04:55:17 +0200 |
---|---|---|
committer | cheatfate <ka@hardcore.kiev.ua> | 2016-11-30 04:55:17 +0200 |
commit | d40b7831108cbb9ce7000ebb2462fe1587494926 (patch) | |
tree | 82c18fc4822ac79c12f0a1797b5b6f7627e35e2c /lib/pure | |
parent | 5c46f268802217b774df23d4dcf07a6f7b0ebc20 (diff) | |
download | Nim-d40b7831108cbb9ce7000ebb2462fe1587494926.tar.gz |
Add comments to latest fixes.
One more fix. Some artifacts removed.
Diffstat (limited to 'lib/pure')
-rw-r--r-- | lib/pure/asyncdispatch.nim | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/lib/pure/asyncdispatch.nim b/lib/pure/asyncdispatch.nim index 01088c2e7..1367bc411 100644 --- a/lib/pure/asyncdispatch.nim +++ b/lib/pure/asyncdispatch.nim @@ -893,9 +893,11 @@ when defined(windows) or defined(nimdoc): deallocShared(cast[pointer](pcd)) raiseOSError(osLastError()) else: - # we ref pcd.ovl one more time, because it will be unrefed in - # poll() + # we incref `pcd.ovl` and `protect` callback one more time, + # because it will be unrefed and disposed in `poll()` after + # callback finishes. GC_ref(pcd.ovl) + pcd.ovl.data.cell = system.protect(rawEnv(pcd.ovl.data.cb)) ) # We need to protect our callback environment value, so GC will not free it # accidentally. @@ -956,17 +958,8 @@ when defined(windows) or defined(nimdoc): initAll() else: import selectors - when defined(windows): - import winlean - const - EINTR = WSAEINPROGRESS - EINPROGRESS = WSAEINPROGRESS - EWOULDBLOCK = WSAEWOULDBLOCK - EAGAIN = EINPROGRESS - MSG_NOSIGNAL = 0 - else: - from posix import EINTR, EAGAIN, EINPROGRESS, EWOULDBLOCK, MSG_PEEK, - MSG_NOSIGNAL + from posix import EINTR, EAGAIN, EINPROGRESS, EWOULDBLOCK, MSG_PEEK, + MSG_NOSIGNAL type AsyncFD* = distinct cint |