Commit d4d73dfe authored by Geoff Simmons's avatar Geoff Simmons

trackrdrd: unified indentation style, some code cleanup

parent e2163244
......@@ -965,7 +965,6 @@ CHILD_Main(struct VSM_data *vd, int endless, int readconfig)
/* Main loop */
term = 0;
/* XXX: Varnish restart? */
/* XXX: TERM not noticed until request received */
while (VSL_Dispatch(vd, OSL_Track, NULL) > 0)
if (term || !endless)
......
......@@ -50,26 +50,6 @@ spmcq_len(void)
return UINT_MAX - spmcq.head + 1 + spmcq.tail;
}
#if 0
/*
* this is only approximately correct and could even become negative when values
* get updated while we read them!
*
*/
int SPMCQ_Len(void) {
unsigned l;
do {
l = spmcq_len();
if (l <= spmcq.mask + 1)
break;
VRMB();
} while (1);
return (l);
}
#endif
static void
spmcq_cleanup(void)
{
......
......@@ -90,7 +90,7 @@ static const char
{
const char *err;
printf("... test worker init (including connect to ActiveMQ)\n");
printf("... test worker init\n");
err = MQ_WorkerInit(&worker);
sprintf(errmsg, "MQ_WorkerInit: %s", err);
......
......@@ -59,7 +59,8 @@ static const char* statename[WRK_STATE_E_LIMIT] = {
[WRK_RUNNING] = "running",
[WRK_WAITING] = "waiting",
[WRK_SHUTTINGDOWN] = "shutting down",
[WRK_EXITED] = "exited"};
[WRK_EXITED] = "exited"
};
struct worker_data_s {
unsigned magic;
......@@ -173,21 +174,16 @@ static void
wrk->deqs++;
wrk_send(amq_worker, entry, wrk);
/* should we go to sleep ? */
if (SPMCQ_StopWorker(running))
goto sleep;
if (!SPMCQ_StopWorker(running))
continue;
}
sleep:
/* return space before sleeping */
if (wrk->wrk_nfree > 0) {
DATA_Return_Freelist(&wrk->wrk_freelist, wrk->wrk_nfree);
wrk->wrk_nfree = 0;
}
/*
* Queue is empty or we should backoff
*
......
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