From 3a209d530568ddfb448d3b55e506022245e394b4 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 14 Dec 2007 17:15:35 +0000 Subject: added thread activation --- threads.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'threads.c') 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 */ -- cgit