struct accept_ev {
LIST_ENTRY(accept_ev) entry;
- struct thread *ev;
- void (*accept_cb)(struct thread *);
+ struct event *ev;
+ void (*accept_cb)(struct event *);
void *arg;
int fd;
};
struct {
LIST_HEAD(, accept_ev) queue;
- struct thread *evt;
+ struct event *evt;
} accept_queue;
static void accept_arm(void);
static void accept_unarm(void);
-static void accept_cb(struct thread *);
-static void accept_timeout(struct thread *);
+static void accept_cb(struct event *);
+static void accept_timeout(struct event *);
void
accept_init(void)
LIST_INIT(&accept_queue.queue);
}
-int accept_add(int fd, void (*cb)(struct thread *), void *arg)
+int accept_add(int fd, void (*cb)(struct event *), void *arg)
{
struct accept_ev *av;
THREAD_OFF(av->ev);
}
-static void accept_cb(struct thread *thread)
+static void accept_cb(struct event *thread)
{
struct accept_ev *av = THREAD_ARG(thread);
thread_add_read(master, accept_cb, av, av->fd, &av->ev);
av->accept_cb(thread);
}
-static void accept_timeout(struct thread *thread)
+static void accept_timeout(struct event *thread)
{
accept_queue.evt = NULL;