mirror of
https://github.com/janet-lang/janet
synced 2024-11-20 07:34:49 +00:00
Timeout is an absolute time, not an interval.
Fixes the wrong assumption, passing all tests at that point.
This commit is contained in:
parent
1736c9b0f8
commit
b559f9625a
@ -1679,7 +1679,11 @@ void janet_loop1_impl(int has_timeout, JanetTimestamp timeout) {
|
|||||||
|
|
||||||
struct kevent timer;
|
struct kevent timer;
|
||||||
if (janet_vm.timer_enabled || has_timeout) {
|
if (janet_vm.timer_enabled || has_timeout) {
|
||||||
EV_SET(&timer, JANET_KQUEUE_TIMER_IDENT, EVFILT_TIMER, EV_ADD | EV_ENABLE | EV_CLEAR, NOTE_MSECONDS, timeout, &janet_vm.timer);
|
EV_SET(&timer,
|
||||||
|
JANET_KQUEUE_TIMER_IDENT,
|
||||||
|
EVFILT_TIMER,
|
||||||
|
EV_ADD | EV_ENABLE | EV_CLEAR,
|
||||||
|
NOTE_MSECONDS | NOTE_ABSTIME, timeout, &janet_vm.timer);
|
||||||
add_kqueue_events(&timer, 1);
|
add_kqueue_events(&timer, 1);
|
||||||
}
|
}
|
||||||
janet_vm.timer_enabled = has_timeout;
|
janet_vm.timer_enabled = has_timeout;
|
||||||
|
Loading…
Reference in New Issue
Block a user