summaryrefslogtreecommitdiffstats
path: root/runtime/wti.c
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/wti.c')
-rw-r--r--runtime/wti.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/runtime/wti.c b/runtime/wti.c
index 69da2e9f..7b88c3eb 100644
--- a/runtime/wti.c
+++ b/runtime/wti.c
@@ -86,7 +86,7 @@ rsRetVal
wtiSetAlwaysRunning(wti_t *pThis)
{
ISOBJ_TYPE_assert(pThis, wti);
- pThis->bAlwaysRunning = TRUE;
+ pThis->bAlwaysRunning = RSTRUE;
return RS_RET_OK;
}
@@ -198,7 +198,7 @@ wtiConstructFinalize(wti_t *pThis)
dbgprintf("%s: finalizing construction of worker instance data\n", wtiGetDbgHdr(pThis));
/* initialize our thread instance descriptor (no concurrency here) */
- pThis->bIsRunning = FALSE;
+ pThis->bIsRunning = RSFALSE;
/* we now alloc the array for user pointers. We obtain the max from the queue itself. */
CHKiRet(pThis->pWtp->pfGetDeqBatchSize(pThis->pWtp->pUsr, &iDeqBatchSize));
@@ -312,7 +312,10 @@ wtiWorker(wti_t *pThis)
*/
localRet = pWtp->pfDoWork(pWtp->pUsr, pThis);
- if(localRet == RS_RET_IDLE) {
+ if(localRet == RS_RET_ERR_QUEUE_EMERGENCY) {
+ d_pthread_mutex_unlock(pWtp->pmutUsr);
+ break; /* end of loop */
+ } else if(localRet == RS_RET_IDLE) {
if(terminateRet == RS_RET_TERMINATE_WHEN_IDLE || bInactivityTOOccured) {
d_pthread_mutex_unlock(pWtp->pmutUsr);
dbgoprint((obj_t*) pThis, "terminating worker terminateRet=%d, bInactivityTOOccured=%d\n",