diff options
Diffstat (limited to 'threads.c')
-rw-r--r-- | threads.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -71,6 +71,7 @@ static rsRetVal thrdConstruct(thrdInfo_t **pThis) static rsRetVal thrdDestruct(thrdInfo_t *pThis) { assert(pThis != NULL); +dbgprintf("thrdDestruct, pThis: %lx\n", pThis); if(pThis->bIsActive == 1) { thrdTerminate(pThis); @@ -88,6 +89,7 @@ rsRetVal thrdTerminate(thrdInfo_t *pThis) { assert(pThis != NULL); +dbgprintf("Terminate thread %d via method %d\n", pThis->thrdID, pThis->eTermTool); if(pThis->eTermTool == eTermSync_SIGNAL) { pthread_kill(pThis->thrdID, SIGUSR2); pthread_join(pThis->thrdID, NULL); @@ -101,6 +103,17 @@ rsRetVal thrdTerminate(thrdInfo_t *pThis) } +/* terminate all known threads gracefully. + */ +rsRetVal thrdTerminateAll(void) +{ +dbgprintf("thrdTerminateAll in\n"); + llDestroy(&llThrds); +dbgprintf("thrdTerminateAll out\n"); + return RS_RET_OK; +} + + /* 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 @@ -115,6 +128,7 @@ rsRetVal thrdCreate(void* (*thrdMain)(void*)) CHKiRet(thrdConstruct(&pThis)); i = pthread_create(&pThis->thrdID, NULL, thrdMain, NULL); + CHKiRet(llAppend(&llThrds, NULL, pThis)); finalize_it: return iRet; |