Commit b3cfe472223ca6e61492892e773f61743b8f2544

Con Kolivas 2012-08-20T22:24:28

Increment total work counter under mutex lock.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/cgminer.c b/cgminer.c
index fbf1ebd..65c575b 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -2043,7 +2043,9 @@ static struct work *make_work(void)
 
 	if (unlikely(!work))
 		quit(1, "Failed to calloc work in make_work");
+	mutex_lock(&control_lock);
 	work->id = total_work++;
+	mutex_unlock(&control_lock);
 	return work;
 }