Browse Source

Merge commit '3b91033' into cg_merges_20121218

Luke Dashjr 13 years ago
parent
commit
9a343919f3
1 changed files with 4 additions and 0 deletions
  1. 4 0
      miner.c

+ 4 - 0
miner.c

@@ -2560,10 +2560,12 @@ static uint64_t share_diff(const struct work *work)
 	if (unlikely(!d64))
 		d64 = 1;
 	ret = diffone / d64;
+	mutex_lock(&control_lock);
 	if (ret > best_diff) {
 		best_diff = ret;
 		suffix_string(best_diff, best_share, 0);
 	}
+	mutex_unlock(&control_lock);
 	return ret;
 }
 
@@ -2575,10 +2577,12 @@ static uint64_t scrypt_diff(const struct work *work)
 	if (unlikely(!d64))
 		d64 = 1;
 	ret = scrypt_diffone / d64;
+	mutex_lock(&control_lock);
 	if (ret > best_diff) {
 		best_diff = ret;
 		suffix_string(best_diff, best_share, 0);
 	}
+	mutex_unlock(&control_lock);
 	return ret;
 }