Only increment wWorkerPool.nextId when wWorkerPool.nextId is launched
Only increment wWorkerPool.nextId when wWorkerPool.nextId is launched
This commit is contained in:
parent
577962ed83
commit
745bb66251
|
@ -132,8 +132,6 @@ void *dnodeAllocateWqueue(void *pVnode) {
|
||||||
taosCloseQueue(queue);
|
taosCloseQueue(queue);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
wWorkerPool.nextId = (wWorkerPool.nextId + 1) % wWorkerPool.max;
|
|
||||||
|
|
||||||
pthread_attr_t thAttr;
|
pthread_attr_t thAttr;
|
||||||
pthread_attr_init(&thAttr);
|
pthread_attr_init(&thAttr);
|
||||||
pthread_attr_setdetachstate(&thAttr, PTHREAD_CREATE_JOINABLE);
|
pthread_attr_setdetachstate(&thAttr, PTHREAD_CREATE_JOINABLE);
|
||||||
|
@ -146,6 +144,7 @@ void *dnodeAllocateWqueue(void *pVnode) {
|
||||||
queue = NULL;
|
queue = NULL;
|
||||||
} else {
|
} else {
|
||||||
dTrace("write worker:%d is launched", pWorker->workerId);
|
dTrace("write worker:%d is launched", pWorker->workerId);
|
||||||
|
wWorkerPool.nextId = (wWorkerPool.nextId + 1) % wWorkerPool.max;
|
||||||
}
|
}
|
||||||
|
|
||||||
pthread_attr_destroy(&thAttr);
|
pthread_attr_destroy(&thAttr);
|
||||||
|
|
Loading…
Reference in New Issue