mirror of
https://github.com/janet-lang/janet
synced 2024-11-10 18:59:54 +00:00
Merge pull request #823 from llmII/fix-kqueue-hang
Fix #822 - kqueue hang in suite 9.
This commit is contained in:
commit
186afa9651
@ -1709,7 +1709,8 @@ void janet_loop1_impl(int has_timeout, JanetTimestamp timeout) {
|
|||||||
} else {
|
} else {
|
||||||
JanetStream *stream = p;
|
JanetStream *stream = p;
|
||||||
JanetListenerState *state = stream->state;
|
JanetListenerState *state = stream->state;
|
||||||
if (NULL != state) {
|
while (NULL != state) {
|
||||||
|
JanetListenerState *next_state = state->_next;
|
||||||
state->event = events + i;
|
state->event = events + i;
|
||||||
JanetAsyncStatus statuses[4];
|
JanetAsyncStatus statuses[4];
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
@ -1730,6 +1731,8 @@ void janet_loop1_impl(int has_timeout, JanetTimestamp timeout) {
|
|||||||
statuses[2] == JANET_ASYNC_STATUS_DONE ||
|
statuses[2] == JANET_ASYNC_STATUS_DONE ||
|
||||||
statuses[3] == JANET_ASYNC_STATUS_DONE)
|
statuses[3] == JANET_ASYNC_STATUS_DONE)
|
||||||
janet_unlisten(state, 0);
|
janet_unlisten(state, 0);
|
||||||
|
|
||||||
|
state = next_state;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user