1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-03-09 12:11:02 +00:00

Update the per-thread view as well to not miss dead threads.

This commit is contained in:
Con Kolivas 2011-07-13 10:51:01 +10:00
parent 81f8af85d6
commit c23827cbcc

17
main.c
View File

@ -526,12 +526,9 @@ static int cpucursor, gpucursor, logstart, logcursor;
static bool curses_active = false;
static struct cgpu_info *gpus, *cpus;
static inline void print_status(int thr_id)
/* Must be called with curses mutex lock held and curses_active */
static inline void __print_status(int thr_id)
{
if (unlikely(!curses_active))
return;
pthread_mutex_lock(&curses_lock);
wmove(statuswin, 0, 0);
wattron(statuswin, A_BOLD);
wprintw(statuswin, PROGRAM_NAME " version " VERSION);
@ -567,7 +564,15 @@ static inline void print_status(int thr_id)
cgpu->efficiency, cgpu->utility);
wclrtoeol(statuswin);
}
}
static void print_status(int thr_id)
{
if (unlikely(!curses_active))
return;
pthread_mutex_lock(&curses_lock);
__print_status(thr_id);
wrefresh(statuswin);
pthread_mutex_unlock(&curses_lock);
}
@ -1718,6 +1723,8 @@ static void *wakeup_thread(void *userdata)
/* Detect screen size change */
if (x != logx || y != logy)
wresize(logwin, y, x);
for (x = 0; x < mining_threads; x++)
__print_status(x);
redrawwin(logwin);
redrawwin(statuswin);
pthread_mutex_unlock(&curses_lock);