From e53d91ce666453b114880e0619dd8c4d40072201 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 15 Oct 2009 18:33:33 +0200 Subject: solved a recently introduced race during input thread shutdown This was introduced when we re-enabled non-cancel thread termination a few commits ago. This code has never been released as a tarball, so that is no bugfix for a release but rather a WiP regression fix and thus does not need to be mentioned in the ChangeLog. --- threads.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'threads.h') diff --git a/threads.h b/threads.h index c37157fe..643f0107 100644 --- a/threads.h +++ b/threads.h @@ -25,7 +25,8 @@ /* the thread object */ struct thrdInfo { - pthread_mutex_t *mutTermOK; /* Is it ok to terminate that thread now? */ + pthread_mutex_t mutThrd;/* mutex for handling long-running operations and shutdown */ + pthread_cond_t condThrdTerm;/* condition: thread terminates (used just for shutdown loop) */ int bIsActive; /* Is thread running? */ int bShallStop; /* set to 1 if the thread should be stopped ? */ rsRetVal (*pUsrThrdMain)(struct thrdInfo*); /* user thread main to be called in new thread */ -- cgit v1.2.3 From e005c5569c3e0c7c9a098036b7ec3596c3c722b4 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 16 Oct 2009 09:42:36 +0200 Subject: some minor cleanup, consolidated some code --- threads.h | 1 - 1 file changed, 1 deletion(-) (limited to 'threads.h') diff --git a/threads.h b/threads.h index 643f0107..1cac02b5 100644 --- a/threads.h +++ b/threads.h @@ -41,7 +41,6 @@ rsRetVal thrdInit(void); rsRetVal thrdTerminate(thrdInfo_t *pThis); rsRetVal thrdTerminateAll(void); rsRetVal thrdCreate(rsRetVal (*thrdMain)(thrdInfo_t*), rsRetVal(*afterRun)(thrdInfo_t *), bool); -rsRetVal thrdSleep(thrdInfo_t *pThis, int iSeconds, int iuSeconds); /* macros (replace inline functions) */ -- cgit v1.2.3