diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-27 14:46:23 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-27 14:46:23 +0000 |
commit | 7d8b1c293746d325db7f93d343a952e382da9ddd (patch) | |
tree | 11eb0c0bceb920fc7e89ecb1fe83bd89e46b9fd2 /wti.c | |
parent | ea7fd874d7b294dacc909a0f8e9c51dcc639d879 (diff) | |
download | rsyslog-7d8b1c293746d325db7f93d343a952e382da9ddd.tar.gz rsyslog-7d8b1c293746d325db7f93d343a952e382da9ddd.tar.xz rsyslog-7d8b1c293746d325db7f93d343a952e382da9ddd.zip |
fixed a bug when shutting down DA queue
Diffstat (limited to 'wti.c')
-rw-r--r-- | wti.c | 10 |
1 files changed, 2 insertions, 8 deletions
@@ -197,17 +197,13 @@ rsRetVal wtiDestruct(wti_t **ppThis) wtiProcessThrdChanges(pThis, LOCK_MUTEX); /* process state change one last time */ d_pthread_mutex_lock(&pThis->mut); -RUNLOG_VAR("%d", pThis->tCurrCmd); if(wtiGetState(pThis, MUTEX_ALREADY_LOCKED) != eWRKTHRD_STOPPED) { dbgprintf("%s: WARNING: worker %p shall be destructed but is still running (might be OK) - joining it\n", wtiGetDbgHdr(pThis), pThis); /* let's hope the caller actually instructed it to shutdown... */ pthread_cond_wait(&pThis->condExitDone, &pThis->mut); -RUNLOG; wtiJoinThrd(pThis); -RUNLOG; } -RUNLOG; d_pthread_mutex_unlock(&pThis->mut); /* actual destruction */ @@ -267,13 +263,11 @@ wtiJoinThrd(wti_t *pThis) DEFiRet; ISOBJ_TYPE_assert(pThis, wti); - dbgprintf("wti: waiting for worker %s termination, current state %d\n", wtiGetDbgHdr(pThis), pThis->tCurrCmd); + dbgprintf("waiting for worker %s termination, current state %d\n", wtiGetDbgHdr(pThis), pThis->tCurrCmd); pthread_join(pThis->thrdID, NULL); -RUNLOG; wtiSetState(pThis, eWRKTHRD_STOPPED, 0, MUTEX_ALREADY_LOCKED); /* back to virgin... */ -RUNLOG_VAR("%p", pThis->thrdID); pThis->thrdID = 0; /* invalidate the thread ID so that we do not accidently find reused ones */ - dbgprintf("wti: worker %s has stopped\n", wtiGetDbgHdr(pThis)); + dbgprintf("worker %s has stopped\n", wtiGetDbgHdr(pThis)); RETiRet; } |