Browse Source

Initialise the stgd lock mutex earlier to prevent dereferences when pool testing occurs before it.

Conflicts:
	cgminer.c
nfactor-troky
Con Kolivas 11 years ago committed by Noel Maersk
parent
commit
cd7f6ed56a
  1. 14
      cgminer.c

14
cgminer.c

@ -7494,6 +7494,13 @@ int main(int argc, char *argv[])
if (unlikely(pthread_cond_init(&gws_cond, NULL))) if (unlikely(pthread_cond_init(&gws_cond, NULL)))
quit(1, "Failed to pthread_cond_init gws_cond"); quit(1, "Failed to pthread_cond_init gws_cond");
/* 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); snprintf(packagename, sizeof(packagename), "%s %s", PACKAGE, VERSION);
handler.sa_handler = &sighandler; handler.sa_handler = &sighandler;
@ -7712,13 +7719,6 @@ int main(int argc, char *argv[])
quit(1, "Failed to calloc mining_thr[%d]", i); quit(1, "Failed to calloc mining_thr[%d]", i);
} }
/* 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) if (opt_benchmark)
goto begin_bench; goto begin_bench;

Loading…
Cancel
Save