r181 - trunk/varnish-cache/bin/varnishd
phk at projects.linpro.no
phk at projects.linpro.no
Wed Jun 14 10:53:21 CEST 2006
Author: phk
Date: 2006-06-14 10:53:21 +0200 (Wed, 14 Jun 2006)
New Revision: 181
Modified:
trunk/varnish-cache/bin/varnishd/cache.h
trunk/varnish-cache/bin/varnishd/cache_acceptor.c
trunk/varnish-cache/bin/varnishd/cache_main.c
Log:
Initialize the cache_acceptor.c/VCA in the same manner as other parts.
Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h 2006-06-14 07:21:48 UTC (rev 180)
+++ trunk/varnish-cache/bin/varnishd/cache.h 2006-06-14 08:53:21 UTC (rev 181)
@@ -60,9 +60,9 @@
/* cache_acceptor.c */
void vca_write(struct sess *sp, void *ptr, size_t len);
void vca_flush(struct sess *sp);
-void *vca_main(void *arg);
void vca_retire_session(struct sess *sp);
void vca_recycle_session(struct sess *sp);
+void VCA_Init(void);
/* cache_backend.c */
void VBE_Init(void);
Modified: trunk/varnish-cache/bin/varnishd/cache_acceptor.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_acceptor.c 2006-06-14 07:21:48 UTC (rev 180)
+++ trunk/varnish-cache/bin/varnishd/cache_acceptor.c 2006-06-14 08:53:21 UTC (rev 181)
@@ -11,6 +11,7 @@
#include <assert.h>
#include <stdlib.h>
#include <unistd.h>
+#include <pthread.h>
#include <sys/uio.h>
#include <sys/types.h>
@@ -33,6 +34,8 @@
static struct event pipe_e;
static int pipes[2];
+static pthread_t vca_thread;
+
#define SESS_IOVS 5
static struct event accept_e[2 * HERITAGE_NSOCKS];
@@ -137,7 +140,7 @@
http_RecvHead(sp->http, sp->fd, evb, DealWithSession, sp);
}
-void *
+static void *
vca_main(void *arg)
{
unsigned u;
@@ -194,3 +197,12 @@
}
free(sp);
}
+
+/*--------------------------------------------------------------------*/
+
+void
+VCA_Init(void)
+{
+
+ AZ(pthread_create(&vca_thread, NULL, vca_main, NULL));
+}
Modified: trunk/varnish-cache/bin/varnishd/cache_main.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_main.c 2006-06-14 07:21:48 UTC (rev 180)
+++ trunk/varnish-cache/bin/varnishd/cache_main.c 2006-06-14 08:53:21 UTC (rev 181)
@@ -24,7 +24,6 @@
#include "cli_event.h"
static struct event ev_keepalive;
-static pthread_t vca_thread;
struct hash_slinger *hash;
struct stevedore *stevedore;
@@ -116,7 +115,7 @@
VSL_Init();
CacheInitPool();
- AZ(pthread_create(&vca_thread, NULL, vca_main, NULL));
+ VCA_Init();
eb = event_init();
assert(eb != NULL);
More information about the varnish-commit
mailing list