Browse Source

inc_hw_errors: Resolve cgpu outside of mutex

Luke Dashjr 12 years ago
parent
commit
045b3d1a2d
1 changed files with 3 additions and 1 deletions
  1. 3 1
      miner.c

+ 3 - 1
miner.c

@@ -7135,9 +7135,11 @@ static void submit_work_async(struct work *work_in, struct timeval *tv_work_foun
 
 void inc_hw_errors(struct thr_info *thr)
 {
+	struct cgpu_info * const cgpu = thr->cgpu;
+	
 	mutex_lock(&stats_lock);
 	hw_errors++;
-	thr->cgpu->hw_errors++;
+	++cgpu->hw_errors;
 	mutex_unlock(&stats_lock);
 
 	if (thr->cgpu->drv->hw_error)