httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h iroshan <>
Subject Re: Creating a new thread inside a module
Date Sat, 04 Jul 2009 19:13:54 GMT
Hi All,

I am still unable to create a new thread inside the balancer_init function.
Here the way that I tried. But in this way  new thread was created and it
terminate after the balancer_init function finish its context. I want run
this new thread for ever until the server stop. Please help me to solve this

static int balancer_init(apr_pool_t *p, apr_pool_t *plog,
                         apr_pool_t *ptemp, server_rec *s)
  apr_status_t rv;
  apr_thread_t *tp;
  apr_threadattr_t *thd_attr;

          rv =apr_thread_create(&tp, thd_attr, doit, ptemp, p);

//do some thing here

return 0;

here is the function passes for creation new thread

static void* APR_THREAD_FUNC doit(apr_thread_t *thread, void *data)
                   //do some thing here


View raw message