mirror of
https://github.com/GOSTSec/sgminer
synced 2025-03-09 20:21:01 +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;
|
||||
}
|
||||
|
||||
/* 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;
|
||||
}
|
||||
}
|
||||
/* Flag the work as ready forcing the mining threads to wait till we
|
||||
* actually put something into the queue */
|
||||
inc_staged(mining_threads, true);
|
||||
|
||||
#ifdef HAVE_OPENCL
|
||||
@ -2005,6 +2000,14 @@ int main (int argc, char *argv[])
|
||||
move(logcursor, 0);
|
||||
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 */
|
||||
pthread_join(thr_info[work_thr_id].pth, NULL);
|
||||
curl_global_cleanup();
|
||||
|
Loading…
x
Reference in New Issue
Block a user