mirror of
https://github.com/GOSTSec/sgminer
synced 2025-03-10 04:31:03 +00:00
Delay any threads from starting till everything is set up properly.
This commit is contained in:
parent
b93e6a4254
commit
78ed386bb4
17
main.c
17
main.c
@ -1902,13 +1902,8 @@ int main (int argc, char *argv[])
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Put enough work in the queue */
|
/* Flag the work as ready forcing the mining threads to wait till we
|
||||||
for (i = 0; i < opt_queue + mining_threads; i++) {
|
* actually put something into the queue */
|
||||||
if (unlikely(!queue_request())) {
|
|
||||||
applog(LOG_ERR, "Failed to queue_request in main");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
inc_staged(mining_threads, true);
|
inc_staged(mining_threads, true);
|
||||||
|
|
||||||
#ifdef HAVE_OPENCL
|
#ifdef HAVE_OPENCL
|
||||||
@ -2005,6 +2000,14 @@ int main (int argc, char *argv[])
|
|||||||
move(logcursor, 0);
|
move(logcursor, 0);
|
||||||
refresh_display();
|
refresh_display();
|
||||||
|
|
||||||
|
/* Now that everything's ready put enough work in the queue */
|
||||||
|
for (i = 0; i < opt_queue + mining_threads; i++) {
|
||||||
|
if (unlikely(!queue_request())) {
|
||||||
|
applog(LOG_ERR, "Failed to queue_request in main");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* main loop - simply wait for workio thread to exit */
|
/* main loop - simply wait for workio thread to exit */
|
||||||
pthread_join(thr_info[work_thr_id].pth, NULL);
|
pthread_join(thr_info[work_thr_id].pth, NULL);
|
||||||
curl_global_cleanup();
|
curl_global_cleanup();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user