summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--runtime/wtp.c3
1 files changed, 2 insertions, 1 deletions
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
}