mirror of
https://github.com/janet-lang/janet
synced 2024-11-24 09:17:17 +00:00
Only re-register when using poll.
This commit is contained in:
parent
12630d3e54
commit
3bc42d0d37
@ -451,7 +451,9 @@ static void *janet_stream_unmarshal(JanetMarshalContext *ctx) {
|
||||
#else
|
||||
p->handle = (JanetHandle) janet_unmarshal_int(ctx);
|
||||
#endif
|
||||
#ifdef JANET_EV_POLL
|
||||
janet_register_stream(p);
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
|
||||
@ -1457,7 +1459,7 @@ void janet_ev_deinit(void) {
|
||||
CloseHandle(janet_vm.iocp);
|
||||
}
|
||||
|
||||
void janet_register_stream(JanetStream *stream) {
|
||||
static void janet_register_stream(JanetStream *stream) {
|
||||
if (NULL == CreateIoCompletionPort(stream->handle, janet_vm.iocp, (ULONG_PTR) stream, 0)) {
|
||||
janet_panicf("failed to listen for events: %V", janet_ev_lasterr());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user