diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-07-20 18:36:30 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-07-20 18:36:30 +0200 |
commit | 7d92de155c832e0a4af2cb3b65f7cef909b19f8d (patch) | |
tree | 9618456aad0bc3ed955a851174d29466c40a46a7 /threads.h | |
parent | 093179e9d366de9319b7ef11ebc57e4e8e789817 (diff) | |
download | rsyslog-7d92de155c832e0a4af2cb3b65f7cef909b19f8d.tar.gz rsyslog-7d92de155c832e0a4af2cb3b65f7cef909b19f8d.tar.xz rsyslog-7d92de155c832e0a4af2cb3b65f7cef909b19f8d.zip |
internal: added ability to terminate input modules not via pthread_cancel...
... but an alternate approach via pthread_kill. This is somewhat safer as we
do not need to think about the cancel-safeness of all libraries we use.
However, not all inputs can easily supported, so this now is a feature
that can be requested by the input module (the most important ones
request it).
Diffstat (limited to 'threads.h')
-rw-r--r-- | threads.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -31,6 +31,7 @@ struct thrdInfo { rsRetVal (*pUsrThrdMain)(struct thrdInfo*); /* user thread main to be called in new thread */ rsRetVal (*pAfterRun)(struct thrdInfo*); /* cleanup function */ pthread_t thrdID; + bool bNeedsCancel; /* must input be terminated by pthread_cancel()? */ }; /* prototypes */ @@ -38,7 +39,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 thrdCreate(rsRetVal (*thrdMain)(thrdInfo_t*), rsRetVal(*afterRun)(thrdInfo_t *), bool); rsRetVal thrdSleep(thrdInfo_t *pThis, int iSeconds, int iuSeconds); /* macros (replace inline functions) */ |