mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-02 10:04:33 +00:00
Need to recheck the pool->curls count on regaining the pool lock after the pthread conditional wait returns.
This commit is contained in:
parent
ad8c4b7755
commit
c7bcad653b
@ -2201,12 +2201,14 @@ static struct curl_ent *pop_curl_entry(struct pool *pool)
|
|||||||
struct curl_ent *ce;
|
struct curl_ent *ce;
|
||||||
|
|
||||||
mutex_lock(&pool->pool_lock);
|
mutex_lock(&pool->pool_lock);
|
||||||
|
retry:
|
||||||
if (!pool->curls)
|
if (!pool->curls)
|
||||||
recruit_curl(pool);
|
recruit_curl(pool);
|
||||||
else if (list_empty(&pool->curlring)) {
|
else if (list_empty(&pool->curlring)) {
|
||||||
if (pool->submit_fail || pool->curls >= curl_limit)
|
if (pool->submit_fail || pool->curls >= curl_limit) {
|
||||||
pthread_cond_wait(&pool->cr_cond, &pool->pool_lock);
|
pthread_cond_wait(&pool->cr_cond, &pool->pool_lock);
|
||||||
else
|
goto retry;
|
||||||
|
} else
|
||||||
recruit_curl(pool);
|
recruit_curl(pool);
|
||||||
}
|
}
|
||||||
ce = list_entry(pool->curlring.next, struct curl_ent, node);
|
ce = list_entry(pool->curlring.next, struct curl_ent, node);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user