[master] 54fbace Split waiter functions into the ones which deal with waiters (Waiter_*) and the ones which deal with fd's being waited on (Wait_*)

Poul-Henning Kamp phk at FreeBSD.org
Thu May 21 18:48:51 CEST 2015


commit 54fbace30c3aa15816c418dd836aa8ef350760f4
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue May 19 09:19:06 2015 +0000

    Split waiter functions into the ones which deal with waiters (Waiter_*)
    and the ones which deal with fd's being waited on (Wait_*)

diff --git a/bin/varnishd/cache/cache_backend_tcp.c b/bin/varnishd/cache/cache_backend_tcp.c
index 518870e..ef037c9 100644
--- a/bin/varnishd/cache/cache_backend_tcp.c
+++ b/bin/varnishd/cache/cache_backend_tcp.c
@@ -178,7 +178,7 @@ VBT_Ref(const struct suckaddr *ip4, const struct suckaddr *ip6)
 	VTAILQ_INIT(&tp->killlist);
 	VTAILQ_INSERT_HEAD(&pools, tp, list);
 	tp->timeout = 60;
-	tp->waiter = Wait_New(tcp_handle, &tp->timeout);
+	tp->waiter = Waiter_New(tcp_handle, &tp->timeout);
 	return (tp);
 }
 
@@ -228,7 +228,7 @@ VBT_Rel(struct tcp_pool **tpp)
 	Lck_Delete(&tp->mtx);
 	AZ(tp->n_conn);
 	AZ(tp->n_kill);
-	Wait_Destroy(&tp->waiter);
+	Waiter_Destroy(&tp->waiter);
 
 	FREE_OBJ(tp);
 }
diff --git a/bin/varnishd/cache/cache_main.c b/bin/varnishd/cache/cache_main.c
index bfe99e3..7baee82 100644
--- a/bin/varnishd/cache/cache_main.c
+++ b/bin/varnishd/cache/cache_main.c
@@ -213,7 +213,7 @@ child_main(void)
 	PAN_Init();
 	VFP_Init();
 
-	Wait_Init();
+	Waiter_Init();
 
 	VCL_Init();
 
diff --git a/bin/varnishd/cache/cache_panic.c b/bin/varnishd/cache/cache_panic.c
index 35e738b..ee1091c 100644
--- a/bin/varnishd/cache/cache_panic.c
+++ b/bin/varnishd/cache/cache_panic.c
@@ -550,7 +550,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, Waiter_GetName());
 
 	pan_backtrace();
 
diff --git a/bin/varnishd/cache/cache_session.c b/bin/varnishd/cache/cache_session.c
index 6153f84..37a6109 100644
--- a/bin/varnishd/cache/cache_session.c
+++ b/bin/varnishd/cache/cache_session.c
@@ -589,7 +589,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_New(ses_handle, &cache_param->timeout_idle);
+	pp->http1_waiter = Waiter_New(ses_handle, &cache_param->timeout_idle);
 
 	VCA_New_SessPool(wp, pp);
 	return (pp);
diff --git a/bin/varnishd/waiter/cache_waiter.c b/bin/varnishd/waiter/cache_waiter.c
index b005eb0..c65adcd 100644
--- a/bin/varnishd/waiter/cache_waiter.c
+++ b/bin/varnishd/waiter/cache_waiter.c
@@ -77,7 +77,7 @@ wait_poker_thread(void *arg)
 }
 
 const char *
-Wait_GetName(void)
+Waiter_GetName(void)
 {
 
 	if (waiter != NULL)
@@ -87,7 +87,7 @@ Wait_GetName(void)
 }
 
 struct waiter *
-Wait_New(waiter_handle_f *func, volatile double *tmo)
+Waiter_New(waiter_handle_f *func, volatile double *tmo)
 {
 	struct waiter *w;
 
@@ -120,7 +120,7 @@ Wait_New(waiter_handle_f *func, volatile double *tmo)
 }
 
 void
-Wait_Destroy(struct waiter **wp)
+Waiter_Destroy(struct waiter **wp)
 {
 	struct waiter *w;
 	struct waited *wx = NULL;
@@ -292,7 +292,7 @@ Wait_Handle(struct waiter *w, struct waited *wp, enum wait_event ev, double now)
 }
 
 void
-Wait_Init(void)
+Waiter_Init(void)
 {
 
 	Lck_New(&wait_mtx, lck_misc);
diff --git a/bin/varnishd/waiter/waiter.h b/bin/varnishd/waiter/waiter.h
index 953df8e..db69e26 100644
--- a/bin/varnishd/waiter/waiter.h
+++ b/bin/varnishd/waiter/waiter.h
@@ -58,10 +58,10 @@ 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_New(waiter_handle_f *, volatile double *timeout);
-void Wait_Destroy(struct waiter **);
-const char *Wait_GetName(void);
-void Wait_Init(void);
+struct waiter *Waiter_New(waiter_handle_f *, volatile double *timeout);
+void Waiter_Destroy(struct waiter **);
+const char *Waiter_GetName(void);
+void Waiter_Init(void);
 
 /* mgt_waiter.c */
 int Wait_Argument(struct vsb *vsb, const char *arg);



More information about the varnish-commit mailing list