summaryrefslogtreecommitdiffstats
path: root/runtime/wti.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2010-05-18 17:53:12 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2010-05-18 17:53:12 +0200
commit7574e70df4c6796878d3b753275f01b5f0d65ade (patch)
treed79350f92fa93c08258836213d3f01f475946b32 /runtime/wti.c
parentaf8582e50914cfc719be1a1a80eeb81030d611c5 (diff)
downloadrsyslog-7574e70df4c6796878d3b753275f01b5f0d65ade.tar.gz
rsyslog-7574e70df4c6796878d3b753275f01b5f0d65ade.tar.xz
rsyslog-7574e70df4c6796878d3b753275f01b5f0d65ade.zip
fixed race conditions during queue shutdown (DA case, disks active)
Diffstat (limited to 'runtime/wti.c')
-rw-r--r--runtime/wti.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/runtime/wti.c b/runtime/wti.c
index 2dfc2d3f..307f1af1 100644
--- a/runtime/wti.c
+++ b/runtime/wti.c
@@ -123,9 +123,7 @@ wtiWakeupThrd(wti_t *pThis)
if(wtiGetState(pThis)) {
/* we first try the cooperative "cancel" interface */
pthread_kill(pThis->thrdID, SIGTTIN);
- dbgprintf("sent SIGTTIN to worker thread %u, giving it a chance to terminate\n", (unsigned) pThis->thrdID);
- srSleep(0, 10000);
- dbgprintf("cooperative worker termination failed, using cancellation...\n");
+ dbgprintf("sent SIGTTIN to worker thread 0x%x\n", (unsigned) pThis->thrdID);
}
RETiRet;
@@ -151,13 +149,13 @@ wtiCancelThrd(wti_t *pThis)
if(wtiGetState(pThis)) {
/* we first try the cooperative "cancel" interface */
-#if 0
pthread_kill(pThis->thrdID, SIGTTIN);
- dbgprintf("sent SIGTTIN to worker thread %u, giving it a chance to terminate\n", (unsigned) pThis->thrdID);
+ dbgprintf("sent SIGTTIN to worker thread 0x%x, giving it a chance to terminate\n", (unsigned) pThis->thrdID);
srSleep(0, 10000);
- dbgprintf("cooperative worker termination failed, using cancellation...\n");
-#endif
+ }
+ if(wtiGetState(pThis)) {
+ dbgprintf("cooperative worker termination failed, using cancellation...\n");
dbgoprint((obj_t*) pThis, "canceling worker thread\n");
pthread_cancel(pThis->thrdID);
/* now wait until the thread terminates... */