mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-25 22:14:36 +00:00
Add a gbt mutex within the pool struct for protecting the gbt values.
This commit is contained in:
parent
8afc1f6512
commit
d10699d4c3
@ -420,12 +420,11 @@ struct pool *add_pool(void)
|
|||||||
pool->pool_no = pool->prio = total_pools;
|
pool->pool_no = pool->prio = total_pools;
|
||||||
pools = realloc(pools, sizeof(struct pool *) * (total_pools + 2));
|
pools = realloc(pools, sizeof(struct pool *) * (total_pools + 2));
|
||||||
pools[total_pools++] = pool;
|
pools[total_pools++] = pool;
|
||||||
if (unlikely(pthread_mutex_init(&pool->pool_lock, NULL)))
|
mutex_init(&pool->pool_lock);
|
||||||
quit(1, "Failed to pthread_mutex_init in add_pool");
|
|
||||||
if (unlikely(pthread_cond_init(&pool->cr_cond, NULL)))
|
if (unlikely(pthread_cond_init(&pool->cr_cond, NULL)))
|
||||||
quit(1, "Failed to pthread_cond_init in add_pool");
|
quit(1, "Failed to pthread_cond_init in add_pool");
|
||||||
if (unlikely(pthread_mutex_init(&pool->stratum_lock, NULL)))
|
mutex_init(&pool->stratum_lock);
|
||||||
quit(1, "Failed to pthread_mutex_init in add_pool");
|
mutex_init(&pool->gbt_lock);
|
||||||
INIT_LIST_HEAD(&pool->curlring);
|
INIT_LIST_HEAD(&pool->curlring);
|
||||||
|
|
||||||
/* Make sure the pool doesn't think we've been idle since time 0 */
|
/* Make sure the pool doesn't think we've been idle since time 0 */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user