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 14 years ago
parent
commit
222d4ee6bf
  1. 6
      main.c

6
main.c

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

Loading…
Cancel
Save