diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2007-12-14 16:51:34 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2007-12-14 16:51:34 +0000 |
commit | 6c0c26dc96544aa5814d00045b3d559c99fc1b2e (patch) | |
tree | 20d558391ba1d881ab3b27f7fbcc636dcfbc67ad /threads.h | |
parent | 6a80d9ee504b57e2b815c91698785d4fcd06f62e (diff) | |
download | rsyslog-6c0c26dc96544aa5814d00045b3d559c99fc1b2e.tar.gz rsyslog-6c0c26dc96544aa5814d00045b3d559c99fc1b2e.tar.xz rsyslog-6c0c26dc96544aa5814d00045b3d559c99fc1b2e.zip |
on the way to a real input module interface and threading class...
Diffstat (limited to 'threads.h')
-rw-r--r-- | threads.h | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -23,6 +23,20 @@ #ifndef THREADS_H_INCLUDED #define THREADS_H_INCLUDED + +/* type of sync tools for terminating the thread */ +typedef enum eTermSyncType { + eTermSync_NONE = 0, /* no cleanup necessary, just cancel thread */ + eTermSync_SIGNAL /* termination via pthread_kill() */ +} eTermSyncType_t; + +/* the thread object */ +typedef struct thrdInfo { + eTermSyncType_t eTermTool; + int bIsActive; /* Is thread running? */ + pthread_t thrdID; +} thrdInfo_t; + /* this is the first approach to a queue, this time with static * memory. */ @@ -35,6 +49,7 @@ typedef struct { } msgQueue; /* prototypes */ +rsRetVal thrdTerminate(thrdInfo_t *pThis); msgQueue *queueInit (void); void queueDelete (msgQueue *q); void queueAdd (msgQueue *q, void* in); |