diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2007-12-17 14:34:22 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2007-12-17 14:34:22 +0000 |
commit | 653ec62b23346eaab4f2f3830eeb7f1634a924c5 (patch) | |
tree | bea302747c51827905f2c8fc7eb8e4e243474149 /threads.c | |
parent | 8132d66186c8c08c44bb3504cb91e2e12bee11c1 (diff) | |
download | rsyslog-653ec62b23346eaab4f2f3830eeb7f1634a924c5.tar.gz rsyslog-653ec62b23346eaab4f2f3830eeb7f1634a924c5.tar.bz2 rsyslog-653ec62b23346eaab4f2f3830eeb7f1634a924c5.zip |
- implemented afterRun input module interface function
- implemented $klogSymbolsTwice config directive
Diffstat (limited to 'threads.c')
-rw-r--r-- | threads.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -99,6 +99,10 @@ dbgprintf("Terminate thread %lx via method %d\n", pThis->thrdID, pThis->eTermToo pthread_cancel(pThis->thrdID); } pThis->bIsActive = 0; + + /* call cleanup function, if any */ + if(pThis->pAfterRun != NULL) + pThis->pAfterRun(pThis); return RS_RET_OK; } @@ -108,9 +112,7 @@ dbgprintf("Terminate thread %lx via method %d\n", pThis->thrdID, pThis->eTermToo */ rsRetVal thrdTerminateAll(void) { -dbgprintf("thrdTerminateAll in\n"); llDestroy(&llThrds); -dbgprintf("thrdTerminateAll out\n"); return RS_RET_OK; } @@ -151,7 +153,7 @@ static void* thrdStarter(void *arg) * executing threads. It is added at the end of the list. * rgerhards, 2007-12-14 */ -rsRetVal thrdCreate(rsRetVal (*thrdMain)(thrdInfo_t*), eTermSyncType_t eTermSyncType) +rsRetVal thrdCreate(rsRetVal (*thrdMain)(thrdInfo_t*), eTermSyncType_t eTermSyncType, rsRetVal(*afterRun)(thrdInfo_t *)) { DEFiRet; thrdInfo_t *pThis; @@ -163,6 +165,7 @@ rsRetVal thrdCreate(rsRetVal (*thrdMain)(thrdInfo_t*), eTermSyncType_t eTermSync pThis->eTermTool = eTermSyncType; pThis->bIsActive = 1; pThis->pUsrThrdMain = thrdMain; + pThis->pAfterRun = afterRun; i = pthread_create(&pThis->thrdID, NULL, thrdStarter, pThis); CHKiRet(llAppend(&llThrds, NULL, pThis)); |