void (*term)(struct poller *p); /* termination of this poller */
int (*test)(struct poller *p); /* pre-init check of the poller */
int (*fork)(struct poller *p); /* post-fork re-opening */
+ void (*fixup_tgid_takeover)(struct poller *p, const int fd, const int old_tid, const int old_tgid); /* Fixup anything necessary after a FD takeover across tgids */
const char *name; /* poller name */
unsigned int flags; /* HAP_POLL_F_* */
int pref; /* try pollers with higher preference first */
}
}
+static void _do_fixup_tgid_takeover(struct poller *poller, const int fd, const int old_ltid, const int old_tgid)
+{
+
+ polled_mask[fd].poll_recv = 0;
+ polled_mask[fd].poll_send = 0;
+ fdtab[fd].update_mask = 0;
+}
+
static void _update_fd(int fd)
{
int en, opcode;
p->term = _do_term;
p->poll = _do_poll;
p->fork = _do_fork;
+ p->fixup_tgid_takeover = _do_fixup_tgid_takeover;
}
/* config parser for global "tune.epoll.mask-events", accepts "err", "hup", "rdhup" */
evports_resync_fd(fd, events);
}
+static void _do_fixup_tgid_takeover(struct poller *poller, const int fd, const int old_ltid, const int old_tgid)
+{
+
+ polled_mask[fd].poll_recv = 0;
+ polled_mask[fd].poll_send = 0;
+ fdtab[fd].update_mask = 0;
+}
+
/*
* Event Ports poller. This routine interacts with the file descriptor
* management data structures and routines; see the large block comment in
p->term = _do_term;
p->poll = _do_poll;
p->fork = _do_fork;
+ p->fixup_tgid_takeover = _do_fixup_tgid_takeover;
}
INITCALL0(STG_REGISTER, _do_register);
return changes;
}
+static void _do_fixup_tgid_takeover(struct poller *poller, const int fd, const int old_ltid, const int old_tgid)
+{
+
+ polled_mask[fd].poll_recv = 0;
+ polled_mask[fd].poll_send = 0;
+ fdtab[fd].update_mask = 0;
+}
+
/*
* kqueue() poller
*/
p->term = _do_term;
p->poll = _do_poll;
p->fork = _do_fork;
+ p->fixup_tgid_takeover = _do_fixup_tgid_takeover;
}
INITCALL0(STG_REGISTER, _do_register);