1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

time: use Duration(C.INT64_MAX) as infinite (#10539)

This commit is contained in:
Uwe Krüger
2021-06-22 11:17:44 +02:00
committed by GitHub
parent dd6591b2f5
commit 72358833e0
10 changed files with 49 additions and 24 deletions

View File

@ -107,10 +107,7 @@ fn (mut en EpollNotifier) wait(timeout time.Duration) []FdEvent {
// the added bonus of making EpollNotifier thread safe
events := [512]C.epoll_event{}
// populate events with the new events
to := match timeout {
time.infinite { -1 }
else { int(timeout / time.millisecond) }
}
to := timeout.sys_milliseconds()
count := C.epoll_wait(en.epoll_fd, &events[0], events.len, to)
if count > 0 {