worker.c revision 1
970N/A#include "libmilter.h"
970N/A#define PIPE_SEND_SIGNAL() \
970N/A#ifndef USE_PIPE_WAKE_POLL
970N/A#ifndef OLD_SESSION_TIMEOUT
#ifndef MIN_WORKERS
#define TASKMGR_LOCK() \
#define TASKMGR_UNLOCK() \
#define TASKMGR_COND_WAIT() \
#define TASKMGR_COND_SIGNAL() \
sm_errstring(r)); \
#if POOL_DEBUG
sm_dprintf x; \
static long id = 0;
return MI_FAILURE;
TASKMGR_LOCK();
return MI_FAILURE;
return MI_SUCCESS;
return MI_SUCCESS;
errno = 0;
return MI_FAILURE;
errno = 0;
return MI_FAILURE;
return MI_SUCCESS;
return MI_SUCCESS;
return MI_FAILURE;
if (r != MI_SUCCESS)
if (r != MI_SUCCESS)
sm_errstring(r));
return MI_FAILURE;
for (i = 0; i < MIN_WORKERS; i++)
sm_errstring(r));
return MI_FAILURE;
return MI_SUCCESS;
void *arg;
int dim_pfd = 0;
bool rebuild_set = true;
return NULL;
return NULL;
TASKMGR_LOCK();
< now)
if (rebuild_set)
nfd = 0;
nfd++;
sizeof(*tpfd);
nfd++;
rebuild_set = false;
if (rfd == 0)
rebuild_set = true;
if (rfd < 0)
pcnt++;
goto err;
pcnt = 0;
for (i = 0; i < nfd; i++)
WAIT_FD(i)));
ssize_t r;
TASKMGR_LOCK();
err:
return NULL;
#define GET_TASK_READY_TO_RUN() \
void *arg;
bool done;
done = false;
return NULL;
TASKMGR_LOCK();
while (!done)
int res;
t_id));
TASKMGR_LOCK();
TASKMGR_LOCK();
done = true;
if (done)
return NULL;
return MI_SUCCESS;
return MI_FAILURE;
return MI_SUCCESS;