mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-02 18:14:20 +00:00
Initialise the stgd lock mutex earlier to prevent dereferences when pool testing occurs before it.
Conflicts: cgminer.c
This commit is contained in:
parent
694a98ece3
commit
cd7f6ed56a
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…
x
Reference in New Issue
Block a user