Commit 42762758 authored by Rusty Russell's avatar Rusty Russell

ccan/io: replace backend_set_state with backend_wakeup()

We only use it in one place: for wakeup.
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent bafb5201
......@@ -103,7 +103,7 @@ bool add_listener(struct io_listener *l);
bool add_conn(struct io_conn *c);
bool add_duplex(struct io_conn *c);
void del_listener(struct io_listener *l);
void backend_set_state(struct io_conn *conn, struct io_plan *op);
void backend_wakeup(struct io_conn *conn);
void backend_add_timeout(struct io_conn *conn, struct timespec ts);
void backend_del_timeout(struct io_conn *conn);
......
......@@ -239,7 +239,8 @@ void io_wake_(struct io_conn *conn,
assert(conn->state == IO_IDLE);
conn->next = fn;
conn->next_arg = arg;
backend_set_state(conn, to_ioplan(IO_NEXT));
conn->state = IO_NEXT;
backend_wakeup(conn);
}
static struct io_plan *do_next(struct io_conn *conn)
......
......@@ -112,7 +112,7 @@ void del_listener(struct io_listener *l)
del_fd(&l->fd);
}
void backend_set_state(struct io_conn *conn, struct io_plan *plan)
static void backend_set_state(struct io_conn *conn, struct io_plan *plan)
{
enum io_state state = from_ioplan(plan);
struct pollfd *pfd = &pollfds[conn->fd.backend_info];
......@@ -138,6 +138,11 @@ void backend_set_state(struct io_conn *conn, struct io_plan *plan)
conn->state = state;
}
void backend_wakeup(struct io_conn *conn)
{
num_next++;
}
static void accept_conn(struct io_listener *l)
{
struct io_conn *c;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment