Commit 852e78e7b43346bd436955ceafdb6e34bd9245c4

Con Kolivas 2011-06-23T22:09:49

Fix mutex unlocking with only one thread and opt_log_interval.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/cpu-miner.c b/cpu-miner.c
index 43b0610..2f70223 100644
--- a/cpu-miner.c
+++ b/cpu-miner.c
@@ -542,11 +542,8 @@ static void hashmeter(int thr_id, struct timeval *diff,
 	} else {
 		total_hashes_done += hashes_done;
 		local_hashes_done += hashes_done;
-		if (total_diff.tv_sec < 5) {
-			/* Only update the total every 5 seconds */
-			pthread_mutex_unlock(&hash_lock);
+		if (total_diff.tv_sec < opt_log_interval) 
 			return;
-		}
 		gettimeofday(&total_tv_end, NULL);
 	}
 	timeval_subtract(&total_diff, &total_tv_end, &total_tv_start);