summaryrefslogtreecommitdiffstats
path: root/threads.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-12-14 17:15:35 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-12-14 17:15:35 +0000
commit3a209d530568ddfb448d3b55e506022245e394b4 (patch)
tree9a9e00ae93679d57223a54554e337aefb6f6cd2e /threads.c
parent6c0c26dc96544aa5814d00045b3d559c99fc1b2e (diff)
downloadrsyslog-3a209d530568ddfb448d3b55e506022245e394b4.tar.gz
rsyslog-3a209d530568ddfb448d3b55e506022245e394b4.tar.xz
rsyslog-3a209d530568ddfb448d3b55e506022245e394b4.zip
added thread activation
Diffstat (limited to 'threads.c')
-rw-r--r--threads.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/threads.c b/threads.c
index d5168d02..d58a291f 100644
--- a/threads.c
+++ b/threads.c
@@ -101,6 +101,26 @@ rsRetVal thrdTerminate(thrdInfo_t *pThis)
}
+/* Start a new thread and add it to the list of currently
+ * executing threads. It is added at the end of the list.
+ * rgerhards, 2007-12-14
+ */
+rsRetVal thrdCreate(void* (*thrdMain)(void*))
+{
+ DEFiRet;
+ thrdInfo_t *pThis;
+ int i;
+
+ assert(thrdMain != NULL);
+
+ CHKiRet(thrdConstruct(&pThis));
+ i = pthread_create(&pThis->thrdID, NULL, thrdMain, NULL);
+
+finalize_it:
+ return iRet;
+}
+
+
/* initialize the thread-support subsystem
* must be called once at the start of the program
*/