Browse Source

Semi-Merge commit 'a105218' into cg_merges_20130818a (just stratum)

Conflicts:
	miner.c
Luke Dashjr 12 years ago
parent
commit
6444119ed4
1 changed files with 2 additions and 3 deletions
  1. 2 3
      miner.c

+ 2 - 3
miner.c

@@ -7714,8 +7714,7 @@ static void gen_stratum_work(struct pool *pool, struct work *work)
 
 	clean_work(work);
 
-	/* Use intermediate lock to update the one pool variable */
-	cg_ilock(&pool->data_lock);
+	cg_wlock(&pool->data_lock);
 
 	/* Generate coinbase */
 	bytes_resize(&work->nonce2, pool->n2size);
@@ -7735,7 +7734,7 @@ static void gen_stratum_work(struct pool *pool, struct work *work)
 	pool->nonce2++;
 
 	/* Downgrade to a read lock to read off the pool variables */
-	cg_dlock(&pool->data_lock);
+	cg_dwlock(&pool->data_lock);
 
 	/* Generate merkle root */
 	gen_hash(coinbase, merkle_root, bytes_len(&pool->swork.coinbase));