Browse Source

Make curses completely inactivated in quiet mode and do not update curses code in wakeup thread when curses is inactive.

nfactor-troky
Con Kolivas 13 years ago
parent
commit
222d4ee6bf
  1. 6
      main.c

6
main.c

@ -1706,6 +1706,7 @@ static void *wakeup_thread(void *userdata) @@ -1706,6 +1706,7 @@ static void *wakeup_thread(void *userdata)
hashmeter(-1, &zero_tv, 0);
if (curses_active) {
pthread_mutex_lock(&curses_lock);
getmaxyx(mainwin, y, x);
getmaxyx(logwin, logy, logx);
@ -1716,6 +1717,7 @@ static void *wakeup_thread(void *userdata) @@ -1716,6 +1717,7 @@ static void *wakeup_thread(void *userdata)
redrawwin(logwin);
redrawwin(statuswin);
pthread_mutex_unlock(&curses_lock);
}
if (unlikely(work_restart[stage_thr_id].restart)) {
restart_threads(false);
@ -1976,6 +1978,7 @@ int main (int argc, char *argv[]) @@ -1976,6 +1978,7 @@ int main (int argc, char *argv[])
pthread_mutex_unlock(&hash_lock);
/* Set up the ncurses interface */
if (!opt_quiet) {
mainwin = initscr();
statuswin = newwin(logstart, 80, 0, 0);
getmaxyx(mainwin, y, x);
@ -1987,6 +1990,7 @@ int main (int argc, char *argv[]) @@ -1987,6 +1990,7 @@ int main (int argc, char *argv[])
curses_active = true;
for (i = 0; i < mining_threads; i++)
print_status(i);
}
/* Now that everything's ready put enough work in the queue */
for (i = 0; i < opt_queue + mining_threads; i++) {
@ -2006,10 +2010,12 @@ int main (int argc, char *argv[]) @@ -2006,10 +2010,12 @@ int main (int argc, char *argv[])
applog(LOG_INFO, "workio thread dead, exiting.");
if (curses_active) {
delwin(logwin);
delwin(statuswin);
endwin();
refresh();
}
return 0;
}

Loading…
Cancel
Save