summaryrefslogtreecommitdiff
path: root/threads.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2011-02-17 21:19:28 +0100
committerMichael Biebl <biebl@debian.org>2011-02-17 21:19:28 +0100
commit4d8f0c039c4fa44bb43d3cdbb0674cde8bb66de4 (patch)
treeed9a0691ad8b9ec5cabfe898c2a44dd4690fbe21 /threads.c
parent537e74be114f1698f9ec825cf8ea497ffc0f17c5 (diff)
downloadrsyslog-4d8f0c039c4fa44bb43d3cdbb0674cde8bb66de4.tar.gz
Imported Upstream version 5.7.4upstream/5.7.4
Diffstat (limited to 'threads.c')
-rw-r--r--threads.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/threads.c b/threads.c
index d4e1452..fcafce4 100644
--- a/threads.c
+++ b/threads.c
@@ -101,12 +101,14 @@ thrdTerminateNonCancel(thrdInfo_t *pThis)
do {
d_pthread_mutex_lock(&pThis->mutThrd);
pthread_kill(pThis->thrdID, SIGTTIN);
- timeoutComp(&tTimeout, 10); /* a fixed 10ms timeout, do after lock (may take long!) */
+ timeoutComp(&tTimeout, 1000); /* a fixed 1sec timeout */
ret = d_pthread_cond_timedwait(&pThis->condThrdTerm, &pThis->mutThrd, &tTimeout);
d_pthread_mutex_unlock(&pThis->mutThrd);
if(Debug) {
if(ret == ETIMEDOUT) {
- dbgprintf("input thread term: had a timeout waiting on thread termination\n");
+ dbgprintf("input thread term: timeout expired waiting on thread termination - canceling\n");
+ pthread_cancel(pThis->thrdID);
+ pThis->bIsActive = 0;
} else if(ret == 0) {
dbgprintf("input thread term: thread returned normally and is terminated\n");
} else {