poller: Remove unnecessary poll_impl abstraction
This commit is contained in:
parent
4f4a17a2bd
commit
3f3bdd41dd
4 changed files with 70 additions and 169 deletions
|
@ -4,6 +4,8 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include "list.h"
|
||||||
|
|
||||||
struct poller;
|
struct poller;
|
||||||
struct event_source_fd;
|
struct event_source_fd;
|
||||||
struct event_source_signal;
|
struct event_source_signal;
|
||||||
|
@ -30,7 +32,7 @@ struct event_source_fd_impl {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The fd poller base class. This must be created by poller_add_fd.
|
* The fd poller class. This must be created by poller_add_fd.
|
||||||
*/
|
*/
|
||||||
struct event_source_fd {
|
struct event_source_fd {
|
||||||
const struct event_source_fd_impl *impl;
|
const struct event_source_fd_impl *impl;
|
||||||
|
@ -39,6 +41,9 @@ struct event_source_fd {
|
||||||
int fd;
|
int fd;
|
||||||
uint32_t mask;
|
uint32_t mask;
|
||||||
void *data;
|
void *data;
|
||||||
|
|
||||||
|
struct poller *poller;
|
||||||
|
bool killed;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -64,7 +69,7 @@ struct event_source_signal_impl {
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The signal poller base class. This must be created by poller_add_signal.
|
* The signal poller class. This must be created by poller_add_signal.
|
||||||
*/
|
*/
|
||||||
struct event_source_signal {
|
struct event_source_signal {
|
||||||
const struct event_source_signal_impl *impl;
|
const struct event_source_signal_impl *impl;
|
||||||
|
@ -72,6 +77,10 @@ struct event_source_signal {
|
||||||
|
|
||||||
int signal;
|
int signal;
|
||||||
void *data;
|
void *data;
|
||||||
|
|
||||||
|
struct poller *poller;
|
||||||
|
bool raised;
|
||||||
|
bool killed;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -98,7 +107,15 @@ struct poll_impl {
|
||||||
* The poller base class. This must be created by poller_create.
|
* The poller base class. This must be created by poller_create.
|
||||||
*/
|
*/
|
||||||
struct poller {
|
struct poller {
|
||||||
const struct poll_impl *impl;
|
struct list signals;
|
||||||
|
struct list new_signals;
|
||||||
|
struct list fds;
|
||||||
|
struct list new_fds;
|
||||||
|
|
||||||
|
struct pollfd *pollfds;
|
||||||
|
size_t pollfds_len;
|
||||||
|
bool dirty;
|
||||||
|
bool inpoll;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -83,8 +83,7 @@ server_files = [
|
||||||
'common/connection.c',
|
'common/connection.c',
|
||||||
'common/evdev.c',
|
'common/evdev.c',
|
||||||
'common/drm.c',
|
'common/drm.c',
|
||||||
'seatd/poll/basic_poller.c',
|
'seatd/poller.c',
|
||||||
'seatd/poll/poller.c',
|
|
||||||
'seatd/seat.c',
|
'seatd/seat.c',
|
||||||
'seatd/client.c',
|
'seatd/client.c',
|
||||||
'seatd/server.c',
|
'seatd/server.c',
|
||||||
|
|
|
@ -1,53 +0,0 @@
|
||||||
#include "poller.h"
|
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
extern const struct poll_impl basic_poller_impl;
|
|
||||||
|
|
||||||
struct poller *poller_create(void) {
|
|
||||||
// TODO: Other poll impls
|
|
||||||
return basic_poller_impl.create();
|
|
||||||
}
|
|
||||||
|
|
||||||
int poller_destroy(struct poller *poller) {
|
|
||||||
assert(poller);
|
|
||||||
assert(poller->impl);
|
|
||||||
return poller->impl->destroy(poller);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct event_source_fd *poller_add_fd(struct poller *poller, int fd, uint32_t mask,
|
|
||||||
event_source_fd_func_t func, void *data) {
|
|
||||||
assert(poller);
|
|
||||||
assert(poller->impl);
|
|
||||||
return poller->impl->add_fd(poller, fd, mask, func, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
int event_source_fd_destroy(struct event_source_fd *event_source) {
|
|
||||||
assert(event_source);
|
|
||||||
assert(event_source->impl);
|
|
||||||
return event_source->impl->destroy(event_source);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct event_source_signal *poller_add_signal(struct poller *poller, int signal,
|
|
||||||
event_source_signal_func_t func, void *data) {
|
|
||||||
assert(poller);
|
|
||||||
assert(poller->impl);
|
|
||||||
return poller->impl->add_signal(poller, signal, func, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
int event_source_signal_destroy(struct event_source_signal *event_source) {
|
|
||||||
assert(event_source);
|
|
||||||
assert(event_source->impl);
|
|
||||||
return event_source->impl->destroy(event_source);
|
|
||||||
}
|
|
||||||
|
|
||||||
int event_source_fd_update(struct event_source_fd *event_source, uint32_t mask) {
|
|
||||||
assert(event_source);
|
|
||||||
assert(event_source->impl);
|
|
||||||
return event_source->impl->update(event_source, mask);
|
|
||||||
}
|
|
||||||
|
|
||||||
int poller_poll(struct poller *poller) {
|
|
||||||
assert(poller);
|
|
||||||
assert(poller->impl);
|
|
||||||
return poller->impl->poll(poller);
|
|
||||||
}
|
|
|
@ -10,50 +10,15 @@
|
||||||
#include "list.h"
|
#include "list.h"
|
||||||
#include "poller.h"
|
#include "poller.h"
|
||||||
|
|
||||||
struct basic_poller *global_poller = NULL;
|
struct poller *global_poller = NULL;
|
||||||
|
|
||||||
const struct poll_impl basic_poller_impl;
|
struct poller *poller_create(void) {
|
||||||
const struct event_source_fd_impl basic_poller_fd_impl;
|
|
||||||
const struct event_source_signal_impl basic_poller_signal_impl;
|
|
||||||
|
|
||||||
struct basic_poller {
|
|
||||||
struct poller base;
|
|
||||||
struct list signals;
|
|
||||||
struct list new_signals;
|
|
||||||
struct list fds;
|
|
||||||
struct list new_fds;
|
|
||||||
|
|
||||||
struct pollfd *pollfds;
|
|
||||||
size_t pollfds_len;
|
|
||||||
bool dirty;
|
|
||||||
bool inpoll;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct basic_poller_fd {
|
|
||||||
struct event_source_fd base;
|
|
||||||
struct basic_poller *poller;
|
|
||||||
bool killed;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct basic_poller_signal {
|
|
||||||
struct event_source_signal base;
|
|
||||||
struct basic_poller *poller;
|
|
||||||
bool raised;
|
|
||||||
bool killed;
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct basic_poller *basic_poller_from_poller(struct poller *base) {
|
|
||||||
assert(base->impl == &basic_poller_impl);
|
|
||||||
return (struct basic_poller *)base;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct poller *basic_poller_create(void) {
|
|
||||||
if (global_poller != NULL) {
|
if (global_poller != NULL) {
|
||||||
errno = EEXIST;
|
errno = EEXIST;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct basic_poller *poller = calloc(1, sizeof(struct basic_poller));
|
struct poller *poller = calloc(1, sizeof(struct poller));
|
||||||
if (poller == NULL) {
|
if (poller == NULL) {
|
||||||
errno = ENOMEM;
|
errno = ENOMEM;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -62,43 +27,41 @@ static struct poller *basic_poller_create(void) {
|
||||||
list_init(&poller->new_fds);
|
list_init(&poller->new_fds);
|
||||||
list_init(&poller->signals);
|
list_init(&poller->signals);
|
||||||
list_init(&poller->new_signals);
|
list_init(&poller->new_signals);
|
||||||
poller->base.impl = &basic_poller_impl;
|
|
||||||
global_poller = poller;
|
global_poller = poller;
|
||||||
return (struct poller *)poller;
|
return poller;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int destroy(struct poller *base) {
|
int poller_destroy(struct poller *poller) {
|
||||||
struct basic_poller *poller = basic_poller_from_poller(base);
|
|
||||||
for (size_t idx = 0; idx < poller->fds.length; idx++) {
|
for (size_t idx = 0; idx < poller->fds.length; idx++) {
|
||||||
struct basic_poller_fd *bpfd = poller->fds.items[idx];
|
struct event_source_fd *bpfd = poller->fds.items[idx];
|
||||||
free(bpfd);
|
free(bpfd);
|
||||||
}
|
}
|
||||||
list_free(&poller->fds);
|
list_free(&poller->fds);
|
||||||
for (size_t idx = 0; idx < poller->new_fds.length; idx++) {
|
for (size_t idx = 0; idx < poller->new_fds.length; idx++) {
|
||||||
struct basic_poller_fd *bpfd = poller->new_fds.items[idx];
|
struct event_source_fd *bpfd = poller->new_fds.items[idx];
|
||||||
free(bpfd);
|
free(bpfd);
|
||||||
}
|
}
|
||||||
list_free(&poller->new_fds);
|
list_free(&poller->new_fds);
|
||||||
for (size_t idx = 0; idx < poller->signals.length; idx++) {
|
for (size_t idx = 0; idx < poller->signals.length; idx++) {
|
||||||
struct basic_poller_signal *bps = poller->signals.items[idx];
|
struct event_source_signal *bps = poller->signals.items[idx];
|
||||||
|
|
||||||
struct sigaction sa;
|
struct sigaction sa;
|
||||||
sa.sa_handler = SIG_DFL;
|
sa.sa_handler = SIG_DFL;
|
||||||
sigemptyset(&sa.sa_mask);
|
sigemptyset(&sa.sa_mask);
|
||||||
sa.sa_flags = 0;
|
sa.sa_flags = 0;
|
||||||
sigaction(bps->base.signal, &sa, NULL);
|
sigaction(bps->signal, &sa, NULL);
|
||||||
|
|
||||||
free(bps);
|
free(bps);
|
||||||
}
|
}
|
||||||
list_free(&poller->signals);
|
list_free(&poller->signals);
|
||||||
for (size_t idx = 0; idx < poller->new_signals.length; idx++) {
|
for (size_t idx = 0; idx < poller->new_signals.length; idx++) {
|
||||||
struct basic_poller_signal *bps = poller->new_signals.items[idx];
|
struct event_source_signal *bps = poller->new_signals.items[idx];
|
||||||
|
|
||||||
struct sigaction sa;
|
struct sigaction sa;
|
||||||
sa.sa_handler = SIG_DFL;
|
sa.sa_handler = SIG_DFL;
|
||||||
sigemptyset(&sa.sa_mask);
|
sigemptyset(&sa.sa_mask);
|
||||||
sa.sa_flags = 0;
|
sa.sa_flags = 0;
|
||||||
sigaction(bps->base.signal, &sa, NULL);
|
sigaction(bps->signal, &sa, NULL);
|
||||||
|
|
||||||
free(bps);
|
free(bps);
|
||||||
}
|
}
|
||||||
|
@ -135,7 +98,7 @@ static uint32_t poll_mask_to_event_mask(int poll_mask) {
|
||||||
return event_mask;
|
return event_mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int regenerate_pollfds(struct basic_poller *poller) {
|
static int regenerate_pollfds(struct poller *poller) {
|
||||||
if (poller->pollfds_len != poller->fds.length) {
|
if (poller->pollfds_len != poller->fds.length) {
|
||||||
struct pollfd *fds = calloc(poller->fds.length, sizeof(struct pollfd));
|
struct pollfd *fds = calloc(poller->fds.length, sizeof(struct pollfd));
|
||||||
if (fds == NULL) {
|
if (fds == NULL) {
|
||||||
|
@ -147,29 +110,26 @@ static int regenerate_pollfds(struct basic_poller *poller) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t idx = 0; idx < poller->fds.length; idx++) {
|
for (size_t idx = 0; idx < poller->fds.length; idx++) {
|
||||||
struct basic_poller_fd *bpfd = poller->fds.items[idx];
|
struct event_source_fd *bpfd = poller->fds.items[idx];
|
||||||
poller->pollfds[idx] = (struct pollfd){
|
poller->pollfds[idx] = (struct pollfd){
|
||||||
.fd = bpfd->base.fd,
|
.fd = bpfd->fd,
|
||||||
.events = event_mask_to_poll_mask(bpfd->base.mask),
|
.events = event_mask_to_poll_mask(bpfd->mask),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct event_source_fd *add_fd(struct poller *base, int fd, uint32_t mask,
|
struct event_source_fd *poller_add_fd(struct poller *poller, int fd, uint32_t mask,
|
||||||
event_source_fd_func_t func, void *data) {
|
event_source_fd_func_t func, void *data) {
|
||||||
struct basic_poller *poller = basic_poller_from_poller(base);
|
struct event_source_fd *bpfd = calloc(1, sizeof(struct event_source_fd));
|
||||||
|
|
||||||
struct basic_poller_fd *bpfd = calloc(1, sizeof(struct basic_poller_fd));
|
|
||||||
if (bpfd == NULL) {
|
if (bpfd == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
bpfd->base.impl = &basic_poller_fd_impl;
|
bpfd->fd = fd;
|
||||||
bpfd->base.fd = fd;
|
bpfd->mask = mask;
|
||||||
bpfd->base.mask = mask;
|
bpfd->data = data;
|
||||||
bpfd->base.data = data;
|
bpfd->func = func;
|
||||||
bpfd->base.func = func;
|
|
||||||
bpfd->poller = poller;
|
bpfd->poller = poller;
|
||||||
poller->dirty = true;
|
poller->dirty = true;
|
||||||
if (poller->inpoll) {
|
if (poller->inpoll) {
|
||||||
|
@ -181,9 +141,9 @@ static struct event_source_fd *add_fd(struct poller *base, int fd, uint32_t mask
|
||||||
return (struct event_source_fd *)bpfd;
|
return (struct event_source_fd *)bpfd;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int fd_destroy(struct event_source_fd *event_source) {
|
int event_source_fd_destroy(struct event_source_fd *event_source) {
|
||||||
struct basic_poller_fd *bpfd = (struct basic_poller_fd *)event_source;
|
struct event_source_fd *bpfd = (struct event_source_fd *)event_source;
|
||||||
struct basic_poller *poller = bpfd->poller;
|
struct poller *poller = bpfd->poller;
|
||||||
int idx = list_find(&poller->fds, event_source);
|
int idx = list_find(&poller->fds, event_source);
|
||||||
if (idx == -1) {
|
if (idx == -1) {
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -199,9 +159,9 @@ static int fd_destroy(struct event_source_fd *event_source) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int fd_update(struct event_source_fd *event_source, uint32_t mask) {
|
int event_source_fd_update(struct event_source_fd *event_source, uint32_t mask) {
|
||||||
struct basic_poller_fd *bpfd = (struct basic_poller_fd *)event_source;
|
struct event_source_fd *bpfd = (struct event_source_fd *)event_source;
|
||||||
struct basic_poller *poller = bpfd->poller;
|
struct poller *poller = bpfd->poller;
|
||||||
event_source->mask = mask;
|
event_source->mask = mask;
|
||||||
|
|
||||||
poller->dirty = true;
|
poller->dirty = true;
|
||||||
|
@ -217,34 +177,32 @@ static void signal_handler(int sig) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t idx = 0; idx < global_poller->signals.length; idx++) {
|
for (size_t idx = 0; idx < global_poller->signals.length; idx++) {
|
||||||
struct basic_poller_signal *bps = global_poller->signals.items[idx];
|
struct event_source_signal *bps = global_poller->signals.items[idx];
|
||||||
if (bps->base.signal == sig) {
|
if (bps->signal == sig) {
|
||||||
bps->raised = true;
|
bps->raised = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct event_source_signal *add_signal(struct poller *base, int signal,
|
struct event_source_signal *poller_add_signal(struct poller *poller, int signal,
|
||||||
event_source_signal_func_t func, void *data) {
|
event_source_signal_func_t func, void *data) {
|
||||||
struct basic_poller *poller = basic_poller_from_poller(base);
|
|
||||||
|
|
||||||
struct basic_poller_signal *bps = calloc(1, sizeof(struct basic_poller_signal));
|
struct event_source_signal *bps = calloc(1, sizeof(struct event_source_signal));
|
||||||
if (bps == NULL) {
|
if (bps == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int refcnt = 0;
|
int refcnt = 0;
|
||||||
for (size_t idx = 0; idx < poller->signals.length; idx++) {
|
for (size_t idx = 0; idx < poller->signals.length; idx++) {
|
||||||
struct basic_poller_signal *bps = poller->signals.items[idx];
|
struct event_source_signal *bps = poller->signals.items[idx];
|
||||||
if (bps->base.signal == signal) {
|
if (bps->signal == signal) {
|
||||||
refcnt++;
|
refcnt++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bps->base.impl = &basic_poller_signal_impl;
|
bps->signal = signal;
|
||||||
bps->base.signal = signal;
|
bps->data = data;
|
||||||
bps->base.data = data;
|
bps->func = func;
|
||||||
bps->base.func = func;
|
|
||||||
bps->poller = poller;
|
bps->poller = poller;
|
||||||
|
|
||||||
if (refcnt == 0) {
|
if (refcnt == 0) {
|
||||||
|
@ -264,9 +222,9 @@ static struct event_source_signal *add_signal(struct poller *base, int signal,
|
||||||
return (struct event_source_signal *)bps;
|
return (struct event_source_signal *)bps;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int signal_destroy(struct event_source_signal *event_source) {
|
int event_source_signal_destroy(struct event_source_signal *event_source) {
|
||||||
struct basic_poller_signal *bps = (struct basic_poller_signal *)event_source;
|
struct event_source_signal *bps = (struct event_source_signal *)event_source;
|
||||||
struct basic_poller *poller = bps->poller;
|
struct poller *poller = bps->poller;
|
||||||
|
|
||||||
int idx = list_find(&poller->signals, event_source);
|
int idx = list_find(&poller->signals, event_source);
|
||||||
if (idx == -1) {
|
if (idx == -1) {
|
||||||
|
@ -275,8 +233,8 @@ static int signal_destroy(struct event_source_signal *event_source) {
|
||||||
|
|
||||||
int refcnt = 0;
|
int refcnt = 0;
|
||||||
for (size_t idx = 0; idx < poller->signals.length; idx++) {
|
for (size_t idx = 0; idx < poller->signals.length; idx++) {
|
||||||
struct basic_poller_signal *b = poller->signals.items[idx];
|
struct event_source_signal *b = poller->signals.items[idx];
|
||||||
if (b->base.signal == bps->base.signal) {
|
if (b->signal == bps->signal) {
|
||||||
refcnt++;
|
refcnt++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -286,7 +244,7 @@ static int signal_destroy(struct event_source_signal *event_source) {
|
||||||
sa.sa_handler = SIG_DFL;
|
sa.sa_handler = SIG_DFL;
|
||||||
sigemptyset(&sa.sa_mask);
|
sigemptyset(&sa.sa_mask);
|
||||||
sa.sa_flags = 0;
|
sa.sa_flags = 0;
|
||||||
sigaction(bps->base.signal, &sa, NULL);
|
sigaction(bps->signal, &sa, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (poller->inpoll) {
|
if (poller->inpoll) {
|
||||||
|
@ -298,9 +256,7 @@ static int signal_destroy(struct event_source_signal *event_source) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int basic_poller_poll(struct poller *base) {
|
int poller_poll(struct poller *poller) {
|
||||||
struct basic_poller *poller = basic_poller_from_poller(base);
|
|
||||||
|
|
||||||
if (poll(poller->pollfds, poller->fds.length, -1) == -1 && errno != EINTR) {
|
if (poll(poller->pollfds, poller->fds.length, -1) == -1 && errno != EINTR) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -312,24 +268,23 @@ static int basic_poller_poll(struct poller *base) {
|
||||||
if (revents == 0) {
|
if (revents == 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
struct basic_poller_fd *bpfd = poller->fds.items[idx];
|
struct event_source_fd *bpfd = poller->fds.items[idx];
|
||||||
bpfd->base.func(poller->pollfds[idx].fd, poll_mask_to_event_mask(revents),
|
bpfd->func(poller->pollfds[idx].fd, poll_mask_to_event_mask(revents), bpfd->data);
|
||||||
bpfd->base.data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t idx = 0; idx < poller->signals.length; idx++) {
|
for (size_t idx = 0; idx < poller->signals.length; idx++) {
|
||||||
struct basic_poller_signal *bps = poller->signals.items[idx];
|
struct event_source_signal *bps = poller->signals.items[idx];
|
||||||
if (!bps->raised) {
|
if (!bps->raised) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bps->base.func(bps->base.signal, bps->base.data);
|
bps->func(bps->signal, bps->data);
|
||||||
bps->raised = false;
|
bps->raised = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
poller->inpoll = false;
|
poller->inpoll = false;
|
||||||
|
|
||||||
for (size_t idx = 0; idx < poller->fds.length; idx++) {
|
for (size_t idx = 0; idx < poller->fds.length; idx++) {
|
||||||
struct basic_poller_fd *bpfd = poller->fds.items[idx];
|
struct event_source_fd *bpfd = poller->fds.items[idx];
|
||||||
if (!bpfd->killed) {
|
if (!bpfd->killed) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -340,7 +295,7 @@ static int basic_poller_poll(struct poller *base) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t idx = 0; idx < poller->signals.length; idx++) {
|
for (size_t idx = 0; idx < poller->signals.length; idx++) {
|
||||||
struct basic_poller_signal *bps = poller->signals.items[idx];
|
struct event_source_signal *bps = poller->signals.items[idx];
|
||||||
if (!bps->killed) {
|
if (!bps->killed) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -367,20 +322,3 @@ static int basic_poller_poll(struct poller *base) {
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct event_source_fd_impl basic_poller_fd_impl = {
|
|
||||||
.update = fd_update,
|
|
||||||
.destroy = fd_destroy,
|
|
||||||
};
|
|
||||||
|
|
||||||
const struct event_source_signal_impl basic_poller_signal_impl = {
|
|
||||||
.destroy = signal_destroy,
|
|
||||||
};
|
|
||||||
|
|
||||||
const struct poll_impl basic_poller_impl = {
|
|
||||||
.create = basic_poller_create,
|
|
||||||
.destroy = destroy,
|
|
||||||
.add_fd = add_fd,
|
|
||||||
.add_signal = add_signal,
|
|
||||||
.poll = basic_poller_poll,
|
|
||||||
};
|
|
Loading…
Add table
Add a link
Reference in a new issue