aboutsummaryrefslogtreecommitdiff
path: root/src/platform/posix/posix_pollq_kqueue.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-05-05 17:21:55 -0700
committerGarrett D'Amore <garrett@damore.org>2018-05-06 15:23:24 -0700
commite52d205799be922db0c1c63ae48a4921707183b4 (patch)
tree897fb0bc3c0318af1e6c4ced7296efd7f88644dc /src/platform/posix/posix_pollq_kqueue.c
parent916ba1ab23aa50b855fd795f095eaedb328e84d9 (diff)
downloadnng-e52d205799be922db0c1c63ae48a4921707183b4.tar.gz
nng-e52d205799be922db0c1c63ae48a4921707183b4.tar.bz2
nng-e52d205799be922db0c1c63ae48a4921707183b4.zip
fixes #393 panic on illumos - epoll assertion error
This replaces the epoll support with proper illumos/SunOS port events. The port event support is structured so that it actually is superior to epoll and kqueue, because it avoids a single master lock on the poller. In the future we will explore this for macOS and Linux pollers.
Diffstat (limited to 'src/platform/posix/posix_pollq_kqueue.c')
-rw-r--r--src/platform/posix/posix_pollq_kqueue.c34
1 files changed, 0 insertions, 34 deletions
diff --git a/src/platform/posix/posix_pollq_kqueue.c b/src/platform/posix/posix_pollq_kqueue.c
index cff0dcf4..0f312170 100644
--- a/src/platform/posix/posix_pollq_kqueue.c
+++ b/src/platform/posix/posix_pollq_kqueue.c
@@ -205,40 +205,6 @@ nni_posix_pollq_arm(nni_posix_pollq_node *node, int events)
nni_mtx_unlock(&pq->mtx);
}
-void
-nni_posix_pollq_disarm(nni_posix_pollq_node *node, int events)
-{
- struct kevent kevents[2];
- int nevents = 0;
-
- nni_posix_pollq *pq = node->pq;
- if (pq == NULL) {
- return;
- }
-
- nni_mtx_lock(&pq->mtx);
-
- if ((node->events & POLLIN) && (events & POLLIN)) {
- EV_SET(&kevents[nevents++], (uintptr_t) node->fd, EVFILT_READ,
- EV_DISABLE, 0, 0, (kevent_udata_t) node);
- }
-
- if ((node->events & POLLOUT) && (events & POLLOUT)) {
- EV_SET(&kevents[nevents++], (uintptr_t) node->fd, EVFILT_WRITE,
- EV_DISABLE, 0, 0, (kevent_udata_t) node);
- }
-
- if (nevents > 0) {
- int rv = kevent(pq->kq, kevents, nevents, NULL, 0, NULL);
- if (rv < 0 && errno != ENOENT && errno != EBADF) {
- NNI_ASSERT(false);
- }
- node->events &= ~events;
- }
-
- nni_mtx_unlock(&pq->mtx);
-}
-
static void
nni_posix_poll_thr(void *arg)
{