Browse Source

Delay any threads from starting till everything is set up properly.

nfactor-troky
Con Kolivas 14 years ago
parent
commit
78ed386bb4
  1. 17
      main.c

17
main.c

@ -1902,13 +1902,8 @@ int main (int argc, char *argv[]) @@ -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[]) @@ -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…
Cancel
Save