From 541696f307e9facc80f2aa153147a9456d41d3f9 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 20 Jul 2009 14:45:32 +0200 Subject: bugfix: potential race condition in debug mode --- runtime/wtp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/wtp.c b/runtime/wtp.c index af4c7621..4524e0c3 100644 --- a/runtime/wtp.c +++ b/runtime/wtp.c @@ -305,10 +305,11 @@ wtpWrkrExecCancelCleanup(void *arg) /* the order of the next two statements is important! */ wtiSetState(pWti, WRKTHRD_STOPPED); ATOMIC_DEC(pThis->iCurNumWrkThrd); - pthread_cond_broadcast(&pThis->condThrdTrm); /* activate anyone waiting on thread shutdown */ DBGPRINTF("%s: Worker thread %lx, terminated, num workers now %d\n", wtpGetDbgHdr(pThis), (unsigned long) pWti, ATOMIC_FETCH_32BIT(pThis->iCurNumWrkThrd)); + + pthread_cond_broadcast(&pThis->condThrdTrm); /* activate anyone waiting on thread shutdown */ ENDfunc } -- cgit