Browse Source

Increment total work counter under mutex lock.

Con Kolivas 13 years ago
parent
commit
b3cfe47222
1 changed files with 2 additions and 0 deletions
  1. 2 0
      cgminer.c

+ 2 - 0
cgminer.c

@@ -2043,7 +2043,9 @@ static struct work *make_work(void)
 
 
 	if (unlikely(!work))
 	if (unlikely(!work))
 		quit(1, "Failed to calloc work in make_work");
 		quit(1, "Failed to calloc work in make_work");
+	mutex_lock(&control_lock);
 	work->id = total_work++;
 	work->id = total_work++;
+	mutex_unlock(&control_lock);
 	return work;
 	return work;
 }
 }