return nc;
}
-static int
+static void
__wait_until_event()
{
block_current();
void
iopoll_init(struct iopoll* ctx)
{
- ctx->pollers = valloc(sizeof(ptr_t) * MAX_POLLER_COUNT);
+ ctx->pollers = vzalloc(sizeof(ptr_t) * MAX_POLLER_COUNT);
ctx->n_poller = 0;
}
llist_delete(&poller->evt_listener);
vfree(poller);
}
-
- vfree(ctx->pollers);
}
+
+ vfree(ctx->pollers);
}
void
time_t t1 = clock_systime() + timeout;
while (!(retcode == __do_poll_round(pinfos, npinfos))) {
- if (timeout >= 0 && t1 >= clock_systime()) {
+ if (timeout >= 0 && t1 < clock_systime()) {
break;
}
__wait_until_event();
time_t t1 = clock_systime() + timeout;
while (!(retcode == __do_poll_all(pinfo))) {
- if (timeout >= 0 && t1 >= clock_systime()) {
+ if (timeout >= 0 && t1 < clock_systime()) {
break;
}
__wait_until_event();