diff options
author | Michael Biebl <biebl@debian.org> | 2010-09-30 14:07:18 +0200 |
---|---|---|
committer | Michael Biebl <biebl@debian.org> | 2010-09-30 14:07:18 +0200 |
commit | 017fb92bd811ce1083504eafda4e2080d9520a31 (patch) | |
tree | 777a2a3627f64f6a0e2bea061c0e392af7437300 /threads.h | |
parent | dea652279a335b6d83050e5f65c45dd762901022 (diff) | |
download | rsyslog-017fb92bd811ce1083504eafda4e2080d9520a31.tar.gz |
Imported Upstream version 5.7.0upstream/5.7.0
Diffstat (limited to 'threads.h')
-rw-r--r-- | threads.h | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -25,12 +25,14 @@ /* the thread object */ struct thrdInfo { - pthread_mutex_t *mutTermOK; /* Is it ok to terminate that thread now? */ + pthread_mutex_t mutThrd;/* mutex for handling long-running operations and shutdown */ + pthread_cond_t condThrdTerm;/* condition: thread terminates (used just for shutdown loop) */ int bIsActive; /* Is thread running? */ int bShallStop; /* set to 1 if the thread should be stopped ? */ rsRetVal (*pUsrThrdMain)(struct thrdInfo*); /* user thread main to be called in new thread */ rsRetVal (*pAfterRun)(struct thrdInfo*); /* cleanup function */ pthread_t thrdID; + sbool bNeedsCancel; /* must input be terminated by pthread_cancel()? */ }; /* prototypes */ @@ -38,8 +40,7 @@ rsRetVal thrdExit(void); rsRetVal thrdInit(void); rsRetVal thrdTerminate(thrdInfo_t *pThis); rsRetVal thrdTerminateAll(void); -rsRetVal thrdCreate(rsRetVal (*thrdMain)(thrdInfo_t*), rsRetVal(*afterRun)(thrdInfo_t *)); -rsRetVal thrdSleep(thrdInfo_t *pThis, int iSeconds, int iuSeconds); +rsRetVal thrdCreate(rsRetVal (*thrdMain)(thrdInfo_t*), rsRetVal(*afterRun)(thrdInfo_t *), sbool); /* macros (replace inline functions) */ |