Queue depth and num workers can race, so make sure that we start at least one worker when there are none active for that queue.
This commit is contained in:
parent
c3d3d39c36
commit
bbadc81d53
1 changed files with 1 additions and 1 deletions
|
@ -347,7 +347,7 @@ async_nif_enqueue_req(struct async_nif_state* async_nif, struct async_nif_req_en
|
||||||
|
|
||||||
/* We've selected a queue for this new request now check to make sure there are
|
/* We've selected a queue for this new request now check to make sure there are
|
||||||
enough workers actively processing requests on this queue. */
|
enough workers actively processing requests on this queue. */
|
||||||
if (q->depth > q->num_workers)
|
if (q->depth > q->num_workers || q->num_workers == 0)
|
||||||
if (async_nif_start_worker(async_nif, q) == 0) q->num_workers++;
|
if (async_nif_start_worker(async_nif, q) == 0) q->num_workers++;
|
||||||
|
|
||||||
/* Build the term before releasing the lock so as not to race on the use of
|
/* Build the term before releasing the lock so as not to race on the use of
|
||||||
|
|
Loading…
Reference in a new issue