diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2007-12-14 17:15:35 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2007-12-14 17:15:35 +0000 |
commit | 3a209d530568ddfb448d3b55e506022245e394b4 (patch) | |
tree | 9a9e00ae93679d57223a54554e337aefb6f6cd2e /threads.c | |
parent | 6c0c26dc96544aa5814d00045b3d559c99fc1b2e (diff) | |
download | rsyslog-3a209d530568ddfb448d3b55e506022245e394b4.tar.gz rsyslog-3a209d530568ddfb448d3b55e506022245e394b4.tar.bz2 rsyslog-3a209d530568ddfb448d3b55e506022245e394b4.zip |
added thread activation
Diffstat (limited to 'threads.c')
-rw-r--r-- | threads.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -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 */ |