]> err.no Git - varnish/commitdiff
Initialize the cache_acceptor.c/VCA in the same manner as other parts.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 14 Jun 2006 08:53:21 +0000 (08:53 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 14 Jun 2006 08:53:21 +0000 (08:53 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@181 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache.h
varnish-cache/bin/varnishd/cache_acceptor.c
varnish-cache/bin/varnishd/cache_main.c

index 459a607ea07b478947dbc31180d145907c38ee06..4ce785b1f82ef82ed0912c99cbcc1773cdd01859 100644 (file)
@@ -60,9 +60,9 @@ extern struct stevedore *stevedore;
 /* 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);
index 4e276b766d28cf023a4b0e9d49d215c777207d92..8eff05426e9880ce098bf57a26a48f2161f79352 100644 (file)
@@ -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_base *evb;
 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 @@ accept_f(int fd, short event, void *arg)
        http_RecvHead(sp->http, sp->fd, evb, DealWithSession, sp);
 }
 
-void *
+static void *
 vca_main(void *arg)
 {
        unsigned u;
@@ -194,3 +197,12 @@ vca_retire_session(struct sess *sp)
        }
        free(sp);
 }
+
+/*--------------------------------------------------------------------*/
+
+void
+VCA_Init(void)
+{
+
+       AZ(pthread_create(&vca_thread, NULL, vca_main, NULL));
+}
index 50023b07582ba75fa8578b76632b012325537951..c20e799359466cc2cb1a35f93b0b5ad2cc9b2f20 100644 (file)
@@ -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 @@ child_main(void)
        VSL_Init();
        CacheInitPool();
 
-       AZ(pthread_create(&vca_thread, NULL, vca_main, NULL));
+       VCA_Init();
 
        eb = event_init();
        assert(eb != NULL);