summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-10-15 18:33:33 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-10-15 18:33:33 +0200
commite53d91ce666453b114880e0619dd8c4d40072201 (patch)
treec937aeef85ab8166b07612e1568abd14e6f370a5 /plugins
parent5b1eb920914d97aee68b674459b68e99957c80d6 (diff)
downloadrsyslog-e53d91ce666453b114880e0619dd8c4d40072201.tar.gz
rsyslog-e53d91ce666453b114880e0619dd8c4d40072201.tar.xz
rsyslog-e53d91ce666453b114880e0619dd8c4d40072201.zip
solved a recently introduced race during input thread shutdown
This was introduced when we re-enabled non-cancel thread termination a few commits ago. This code has never been released as a tarball, so that is no bugfix for a release but rather a WiP regression fix and thus does not need to be mentioned in the ChangeLog.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/imudp/imudp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/imudp/imudp.c b/plugins/imudp/imudp.c
index 3159de4f..f8227fa7 100644
--- a/plugins/imudp/imudp.c
+++ b/plugins/imudp/imudp.c
@@ -295,7 +295,7 @@ finalize_it:
*/
#if defined(HAVE_EPOLL_CREATE1) || defined(HAVE_EPOLL_CREATE)
#define NUM_EPOLL_EVENTS 10
-rsRetVal rcvMainLoop()
+rsRetVal rcvMainLoop(thrdInfo_t *pThrd)
{
DEFiRet;
int nfds;
@@ -350,7 +350,7 @@ rsRetVal rcvMainLoop()
nfds = epoll_wait(efd, currEvt, NUM_EPOLL_EVENTS, -1);
DBGPRINTF("imudp: epoll_wait() returned with %d fds\n", nfds);
- if(glbl.GetGlobalInputTermState() == 1)
+ if(pThrd->bShallStop == TRUE)
break; /* terminate input! */
for(i = 0 ; i < nfds ; ++i) {
@@ -367,7 +367,7 @@ finalize_it:
}
#else /* #if HAVE_EPOLL_CREATE1 */
/* this is the code for the select() interface */
-rsRetVal rcvMainLoop()
+rsRetVal rcvMainLoop(thrdInfo_t *pThrd)
{
DEFiRet;
int maxfds;
@@ -443,7 +443,7 @@ CODESTARTrunInput
* signalled to do so. This, however, is handled by the framework,
* right into the sleep below.
*/
- iRet = rcvMainLoop();
+ iRet = rcvMainLoop(pThrd);
ENDrunInput