summaryrefslogtreecommitdiffstats
path: root/runtime/wti.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-07-20 10:25:02 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-07-20 10:25:02 +0200
commitef70e6174d4b373a601b73757ca19bb0f7dd6502 (patch)
tree50bc958008b9cd4c7faf838e8911acc0e4c089b5 /runtime/wti.c
parentb3978e7f7381c694a30a83c67c3fe2e1acc54207 (diff)
downloadrsyslog-ef70e6174d4b373a601b73757ca19bb0f7dd6502.tar.gz
rsyslog-ef70e6174d4b373a601b73757ca19bb0f7dd6502.tar.xz
rsyslog-ef70e6174d4b373a601b73757ca19bb0f7dd6502.zip
architecture change: queue now always has at least one worker thread
...if not running in direct mode. Previous versions could run without any active workers. This simplifies the code at a very small expense. See v5 compatibility note document for more in-depth discussion.
Diffstat (limited to 'runtime/wti.c')
-rw-r--r--runtime/wti.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/runtime/wti.c b/runtime/wti.c
index b55ff69c..1d8f075f 100644
--- a/runtime/wti.c
+++ b/runtime/wti.c
@@ -86,6 +86,17 @@ wtiGetState(wti_t *pThis)
}
+/* Set this thread to "always running" state (can not be unset)
+ * rgerhards, 2009-07-20
+ */
+rsRetVal
+wtiSetAlwaysRunning(wti_t *pThis)
+{
+ ISOBJ_TYPE_assert(pThis, wti);
+ pThis->bAlwaysRunning = TRUE;
+ return RS_RET_OK;
+}
+
/* Set status (thread is running or not), actually an property of
* use for wtp, but we need to have it per thread instance (thus it
* is inside wti). -- rgerhards, 2009-07-17
@@ -202,7 +213,8 @@ doIdleProcessing(wti_t *pThis, wtp_t *pWtp, int *pbInactivityTOOccured)
pWtp->pfOnIdle(pWtp->pUsr, MUTEX_ALREADY_LOCKED);
d_pthread_mutex_lock(pWtp->pmutUsr);
- if(pWtp->toWrkShutdown == -1) {
+RUNLOG_VAR("%d", pThis->bAlwaysRunning);
+ if(pThis->bAlwaysRunning) {
/* never shut down any started worker */
d_pthread_cond_wait(pWtp->pcondBusy, pWtp->pmutUsr);
} else {