mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-05 11:34:16 +00:00
Only add to the pool curlring and increment the counter under mutex lock.
This commit is contained in:
parent
920c56c93b
commit
8897e06575
@ -2185,8 +2185,10 @@ static void recruit_curl(struct pool *pool)
|
|||||||
if (unlikely(!ce->curl || !ce))
|
if (unlikely(!ce->curl || !ce))
|
||||||
quit(1, "Failed to init in recruit_curl");
|
quit(1, "Failed to init in recruit_curl");
|
||||||
|
|
||||||
|
mutex_lock(&pool->pool_lock);
|
||||||
list_add(&ce->node, &pool->curlring);
|
list_add(&ce->node, &pool->curlring);
|
||||||
pool->curls++;
|
pool->curls++;
|
||||||
|
mutex_unlock(&pool->pool_lock);
|
||||||
applog(LOG_DEBUG, "Recruited curl %d for pool %d", pool->curls, pool->pool_no);
|
applog(LOG_DEBUG, "Recruited curl %d for pool %d", pool->curls, pool->pool_no);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user