Commit 1520837f authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Systematic rename to make things consistent

parent 2b72a16e
......@@ -539,7 +539,7 @@ pan_ic(const char *func, const char *file, int line, const char *cond,
VSB_printf(pan_vsp, "version = %s\n", VCS_version);
VSB_printf(pan_vsp, "ident = %s,%s\n",
VSB_data(vident) + 1, WAIT_GetName());
VSB_data(vident) + 1, Wait_GetName());
pan_backtrace();
......
......@@ -296,7 +296,7 @@ SES_Wait(struct sess *sp)
sp->waited.fd = sp->fd;
sp->waited.ptr = sp;
sp->waited.deadline = sp->t_idle;
if (WAIT_Enter(pp->http1_waiter, &sp->waited)) {
if (Wait_Enter(pp->http1_waiter, &sp->waited)) {
VSC_C_main->sess_pipe_overflow++;
SES_Delete(sp, SC_SESS_PIPE_OVERFLOW, NAN);
}
......@@ -467,7 +467,7 @@ SES_NewPool(struct pool *wp, unsigned pool_no)
bprintf(nb, "sess%u", pool_no);
pp->mpl_sess = MPL_New(nb, &cache_param->sess_pool,
&cache_param->workspace_session);
pp->http1_waiter = WAIT_Init(ses_handle, &cache_param->timeout_idle);
pp->http1_waiter = Wait_New(ses_handle, &cache_param->timeout_idle);
return (pp);
}
......
......@@ -574,7 +574,7 @@ tweak_waiter(struct vsb *vsb, const struct parspec *par, const char *arg)
/* XXX should have tweak_generic_string */
(void)par;
return (WAIT_tweak_waiter(vsb, arg));
return (Wait_Argument(vsb, arg));
}
/*--------------------------------------------------------------------*/
......
......@@ -45,7 +45,7 @@
#define NEV 8192
const char *
WAIT_GetName(void)
Wait_GetName(void)
{
if (waiter != NULL)
......@@ -55,7 +55,7 @@ WAIT_GetName(void)
}
struct waiter *
WAIT_Init(waiter_handle_f *func, volatile double *tmo)
Wait_New(waiter_handle_f *func, volatile double *tmo)
{
struct waiter *w;
......@@ -70,7 +70,7 @@ WAIT_Init(waiter_handle_f *func, volatile double *tmo)
w->impl = waiter;
w->func = func;
w->tmo = tmo;
VTAILQ_INIT(&w->sesshead);
VTAILQ_INIT(&w->waithead);
waiter->init(w);
AN(w->impl->pass || w->pfd > 0);
......@@ -78,7 +78,7 @@ WAIT_Init(waiter_handle_f *func, volatile double *tmo)
}
void
WAIT_UsePipe(struct waiter *w)
Wait_UsePipe(struct waiter *w)
{
CHECK_OBJ_NOTNULL(w, WAITER_MAGIC);
......@@ -90,12 +90,12 @@ WAIT_UsePipe(struct waiter *w)
ALLOC_OBJ(w->pipe_w, WAITED_MAGIC);
w->pipe_w->fd = w->pipes[0];
w->pipe_w->deadline = 9e99;
VTAILQ_INSERT_HEAD(&w->sesshead, w->pipe_w, list);
VTAILQ_INSERT_HEAD(&w->waithead, w->pipe_w, list);
waiter->inject(w, w->pipe_w);
}
int
WAIT_Enter(const struct waiter *w, struct waited *wp)
Wait_Enter(const struct waiter *w, struct waited *wp)
{
ssize_t written;
......@@ -116,7 +116,7 @@ WAIT_Enter(const struct waiter *w, struct waited *wp)
}
void
WAIT_handle(struct waiter *w, struct waited *wp, enum wait_event ev, double now)
Wait_Handle(struct waiter *w, struct waited *wp, enum wait_event ev, double now)
{
struct waited *ss[NEV];
int i, j;
......@@ -131,7 +131,7 @@ WAIT_handle(struct waiter *w, struct waited *wp, enum wait_event ev, double now)
for (j = 0; i >= sizeof ss[0]; j++, i -= sizeof ss[0]) {
CHECK_OBJ_NOTNULL(ss[j], WAITED_MAGIC);
assert(ss[j]->fd >= 0);
VTAILQ_INSERT_TAIL(&w->sesshead, ss[j], list);
VTAILQ_INSERT_TAIL(&w->waithead, ss[j], list);
w->impl->inject(w, ss[j]);
}
AZ(i);
......@@ -140,6 +140,6 @@ WAIT_handle(struct waiter *w, struct waited *wp, enum wait_event ev, double now)
if (w->impl->evict != NULL)
w->impl->evict(w, wp);
VTAILQ_REMOVE(&w->sesshead, wp, list);
VTAILQ_REMOVE(&w->waithead, wp, list);
w->func(wp, ev, now);
}
......@@ -92,13 +92,13 @@ vwe_eev(struct vwe *vwe, const struct epoll_event *ep, double now)
AN(ep->data.ptr);
CAST_OBJ_NOTNULL(sp, ep->data.ptr, WAITED_MAGIC);
if (ep->events & EPOLLIN || ep->events & EPOLLPRI) {
WAIT_handle(vwe->waiter, sp, WAITER_ACTION, now);
Wait_Handle(vwe->waiter, sp, WAITER_ACTION, now);
} else if (ep->events & EPOLLERR) {
WAIT_handle(vwe->waiter, sp, WAITER_REMCLOSE, now);
Wait_Handle(vwe->waiter, sp, WAITER_REMCLOSE, now);
} else if (ep->events & EPOLLHUP) {
WAIT_handle(vwe->waiter, sp, WAITER_REMCLOSE, now);
Wait_Handle(vwe->waiter, sp, WAITER_REMCLOSE, now);
} else if (ep->events & EPOLLRDHUP) {
WAIT_handle(vwe->waiter, sp, WAITER_REMCLOSE, now);
Wait_Handle(vwe->waiter, sp, WAITER_REMCLOSE, now);
}
}
......@@ -136,9 +136,9 @@ vwe_thread(void *priv)
/* check for timeouts */
deadline = now - *vwe->waiter->tmo;
VTAILQ_FOREACH_SAFE(sp, &vwe->waiter->sesshead, list, sp2) {
VTAILQ_FOREACH_SAFE(sp, &vwe->waiter->waithead, list, sp2) {
if (sp->deadline < deadline)
WAIT_handle(vwe->waiter, sp,
Wait_Handle(vwe->waiter, sp,
WAITER_TIMEOUT, now);
}
}
......@@ -180,7 +180,7 @@ vwe_init(struct waiter *w)
vwe->epfd = epoll_create(1);
assert(vwe->epfd >= 0);
WAIT_UsePipe(w);
Wait_UsePipe(w);
AZ(pipe(vwe->timer_pipes));
AZ(VFIL_nonblocking(vwe->timer_pipes[0]));
......
......@@ -110,10 +110,10 @@ vwk_sess_ev(const struct vwk *vwk, const struct kevent *kp, double now)
CAST_OBJ_NOTNULL(sp, kp->udata, WAITED_MAGIC);
if (kp->data > 0) {
WAIT_handle(vwk->waiter, sp, WAITER_ACTION, now);
Wait_Handle(vwk->waiter, sp, WAITER_ACTION, now);
return;
} else if (kp->flags & EV_EOF) {
WAIT_handle(vwk->waiter, sp, WAITER_REMCLOSE, now);
Wait_Handle(vwk->waiter, sp, WAITER_REMCLOSE, now);
return;
} else {
WRONG("unknown kqueue state");
......@@ -171,12 +171,12 @@ vwk_thread(void *priv)
vwk_kq_flush(vwk);
deadline = now - *vwk->waiter->tmo;
for (;;) {
sp = VTAILQ_FIRST(&vwk->waiter->sesshead);
sp = VTAILQ_FIRST(&vwk->waiter->waithead);
if (sp == NULL)
break;
if (sp->deadline > deadline)
break;
WAIT_handle(vwk->waiter, sp, WAITER_TIMEOUT, now);
Wait_Handle(vwk->waiter, sp, WAITER_TIMEOUT, now);
}
}
NEEDLESS_RETURN(NULL);
......@@ -197,7 +197,7 @@ vwk_init(struct waiter *w)
EV_SET(&vwk->ki[vwk->nki], 0, EVFILT_TIMER, EV_ADD, 0, 100, NULL);
vwk->nki++;
WAIT_UsePipe(w);
Wait_UsePipe(w);
AZ(pthread_create(&vwk->thread, NULL, vwk_thread, vwk));
}
......
......@@ -146,7 +146,7 @@ vwp_main(void *priv)
v2 = v;
now = VTIM_real();
deadline = now - *vwp->waiter->tmo;
VTAILQ_FOREACH_SAFE(sp, &vwp->waiter->sesshead, list, sp2) {
VTAILQ_FOREACH_SAFE(sp, &vwp->waiter->waithead, list, sp2) {
if (v != 0 && v2 == 0)
break;
CHECK_OBJ_NOTNULL(sp, WAITED_MAGIC);
......@@ -158,10 +158,10 @@ vwp_main(void *priv)
if (vwp->pollfd[fd].revents) {
v2--;
vwp->pollfd[fd].revents = 0;
WAIT_handle(vwp->waiter, sp, WAITER_ACTION,
Wait_Handle(vwp->waiter, sp, WAITER_ACTION,
now);
} else if (sp->deadline <= deadline) {
WAIT_handle(vwp->waiter, sp, WAITER_TIMEOUT,
Wait_Handle(vwp->waiter, sp, WAITER_TIMEOUT,
now);
}
}
......@@ -182,7 +182,7 @@ vwp_poll_init(struct waiter *w)
vwp->waiter = w;
vwp_pollspace(vwp, 256);
WAIT_UsePipe(w);
Wait_UsePipe(w);
AZ(pthread_create(&vwp->poll_thread, NULL, vwp_main, vwp));
}
......
......@@ -79,7 +79,7 @@ vws_port_ev(struct vws *vws, port_event_t *ev, double now) {
if(ev->portev_source == PORT_SOURCE_USER) {
CAST_OBJ_NOTNULL(sp, ev->portev_user, WAITED_MAGIC);
assert(sp->fd >= 0);
VTAILQ_INSERT_TAIL(&vws->waiter->sesshead, sp, list);
VTAILQ_INSERT_TAIL(&vws->waiter->waithead, sp, list);
vws_add(vws, sp->fd, sp);
} else {
assert(ev->portev_source == PORT_SOURCE_FD);
......@@ -87,7 +87,7 @@ vws_port_ev(struct vws *vws, port_event_t *ev, double now) {
assert(sp->fd >= 0);
if(ev->portev_events & POLLERR) {
vws_del(vws, sp->fd);
WAIT_handle(vws->waiter, sp, WAITER_REMCLOSE, now);
Wait_Handle(vws->waiter, sp, WAITER_REMCLOSE, now);
return;
}
......@@ -105,7 +105,7 @@ vws_port_ev(struct vws *vws, port_event_t *ev, double now) {
* threadID=129476&tstart=0
*/
vws_del(vws, sp->fd);
WAIT_handle(vws->waiter, sp, WAITER_ACTION, now);
Wait_Handle(vws->waiter, sp, WAITER_ACTION, now);
}
return;
}
......@@ -199,14 +199,14 @@ vws_thread(void *priv)
*/
for (;;) {
sp = VTAILQ_FIRST(&vws->waiter->sesshead);
sp = VTAILQ_FIRST(&vws->waiter->waithead);
if (sp == NULL)
break;
if (sp->deadline > deadline) {
break;
}
vws_del(vws, sp->fd);
WAIT_handle(vws->waiter, sp, WAITER_TIMEOUT, now);
Wait_Handle(vws->waiter, sp, WAITER_TIMEOUT, now);
}
/*
......
......@@ -55,7 +55,7 @@ static const struct waiter_impl *const waiter_impls[] = {
struct waiter_impl const *waiter;
int
WAIT_tweak_waiter(struct vsb *vsb, const char *arg)
Wait_Argument(struct vsb *vsb, const char *arg)
{
int i;
......
......@@ -56,9 +56,9 @@ enum wait_event {
typedef void waiter_handle_f(struct waited *, enum wait_event, double now);
/* cache_waiter.c */
int WAIT_Enter(const struct waiter *, struct waited *);
struct waiter *WAIT_Init(waiter_handle_f *, volatile double *timeout);
const char *WAIT_GetName(void);
int Wait_Enter(const struct waiter *, struct waited *);
struct waiter *Wait_New(waiter_handle_f *, volatile double *timeout);
const char *Wait_GetName(void);
/* mgt_waiter.c */
int WAIT_tweak_waiter(struct vsb *vsb, const char *arg);
int Wait_Argument(struct vsb *vsb, const char *arg);
......@@ -41,7 +41,7 @@ struct waiter {
struct waited *pipe_w;
volatile double *tmo;
VTAILQ_HEAD(,waited) sesshead;
VTAILQ_HEAD(,waited) waithead;
void *priv;
int pfd;
......@@ -62,8 +62,8 @@ struct waiter_impl {
};
/* cache_waiter.c */
void WAIT_handle(struct waiter *, struct waited *, enum wait_event, double now);
void WAIT_UsePipe(struct waiter *w);
void Wait_Handle(struct waiter *, struct waited *, enum wait_event, double now);
void Wait_UsePipe(struct waiter *w);
/* mgt_waiter.c */
extern struct waiter_impl const * waiter;
......
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