Browse Source

Bugfix: Initialise getq (and stgd_lock) earlier so it is ready in case startup interactive pool-add tries to stage work

Luke Dashjr 11 years ago
parent
commit
cd125429fc
1 changed files with 7 additions and 9 deletions
  1. 7 9
      miner.c

+ 7 - 9
miner.c

@@ -254,7 +254,6 @@ bool opt_bfl_noncerange;
 
 struct thr_info *control_thr;
 struct thr_info **mining_thr;
-static int gwsched_thr_id;
 static int watchpool_thr_id;
 static int watchdog_thr_id;
 #ifdef HAVE_CURSES
@@ -11603,6 +11602,13 @@ int main(int argc, char *argv[])
 	timer_unset(&tv_rescan);
 	notifier_init(rescan_notifier);
 
+	/* Create a unique get work queue */
+	getq = tq_new();
+	if (!getq)
+		quit(1, "Failed to create getq");
+	/* We use the getq mutex as the staged lock */
+	stgd_lock = &getq->mutex;
+
 	snprintf(packagename, sizeof(packagename), "%s %s", PACKAGE, VERSION);
 
 #ifdef WANT_CPUMINE
@@ -11954,14 +11960,6 @@ int main(int argc, char *argv[])
 	if (!control_thr)
 		quit(1, "Failed to calloc control_thr");
 
-	gwsched_thr_id = 0;
-	/* Create a unique get work queue */
-	getq = tq_new();
-	if (!getq)
-		quit(1, "Failed to create getq");
-	/* We use the getq mutex as the staged lock */
-	stgd_lock = &getq->mutex;
-
 	if (opt_benchmark)
 		goto begin_bench;