summaryrefslogtreecommitdiffstats
path: root/threads.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-12-14 16:51:34 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-12-14 16:51:34 +0000
commit6c0c26dc96544aa5814d00045b3d559c99fc1b2e (patch)
tree20d558391ba1d881ab3b27f7fbcc636dcfbc67ad /threads.h
parent6a80d9ee504b57e2b815c91698785d4fcd06f62e (diff)
downloadrsyslog-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.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/threads.h b/threads.h
index 5f3faab7..dd2b17f7 100644
--- a/threads.h
+++ b/threads.h
@@ -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);