diff options
author | Araq <rumpf_a@web.de> | 2016-12-01 10:06:41 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2016-12-01 10:06:41 +0100 |
commit | 2eee15d7f36bc06187d347900fdd0bf78f461f5c (patch) | |
tree | fdd3b0f4d659589323db7fe787123d9ab6780b80 /lib/pure/asyncdispatch.nim | |
parent | a1737030156283e64c6cf0d7ef7468762aaee203 (diff) | |
parent | de844c7767fa341c96c38e279f064a0e7f4db641 (diff) | |
download | Nim-2eee15d7f36bc06187d347900fdd0bf78f461f5c.tar.gz |
Merge branch 'devel' into sighashes
Diffstat (limited to 'lib/pure/asyncdispatch.nim')
-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 |