Allow async stdin
This commit is contained in:
parent
d5c9255cab
commit
34f398d010
5 changed files with 51 additions and 48 deletions
|
|
@ -261,6 +261,9 @@ else:
|
|||
param: int
|
||||
data: T
|
||||
|
||||
const
|
||||
InvalidIdent = -1
|
||||
|
||||
proc raiseIOSelectorsError[T](message: T) =
|
||||
var msg = ""
|
||||
when T is string:
|
||||
|
|
@ -302,6 +305,12 @@ else:
|
|||
if posix.sigprocmask(SIG_UNBLOCK, newmask, oldmask) == -1:
|
||||
raiseIOSelectorsError(osLastError())
|
||||
|
||||
template clearKey[T](key: ptr SelectorKey[T]) =
|
||||
var empty: T
|
||||
key.ident = InvalidIdent
|
||||
key.events = {}
|
||||
key.data = empty
|
||||
|
||||
when defined(linux):
|
||||
include ioselects/ioselectors_epoll
|
||||
elif bsdPlatform:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue