|
|
@@ -357,6 +357,8 @@ bool selecting_device;
|
|
|
unsigned selected_device;
|
|
|
#endif
|
|
|
|
|
|
+static int max_lpdigits;
|
|
|
+
|
|
|
static char current_block[40];
|
|
|
|
|
|
/* Protected by ch_lock */
|
|
|
@@ -1050,7 +1052,7 @@ struct pool *add_pool(void)
|
|
|
mutex_init(&pool->last_work_lock);
|
|
|
mutex_init(&pool->pool_lock);
|
|
|
mutex_init(&pool->pool_test_lock);
|
|
|
- if (unlikely(pthread_cond_init(&pool->cr_cond, NULL)))
|
|
|
+ if (unlikely(pthread_cond_init(&pool->cr_cond, bfg_condattr)))
|
|
|
quit(1, "Failed to pthread_cond_init in add_pool");
|
|
|
cglock_init(&pool->data_lock);
|
|
|
mutex_init(&pool->stratum_lock);
|
|
|
@@ -3763,7 +3765,7 @@ void get_statline3(char *buf, size_t bufsz, struct cgpu_info *cgpu, bool for_cur
|
|
|
if (for_curses)
|
|
|
{
|
|
|
if (opt_show_procs)
|
|
|
- snprintf(buf, bufsz, " %"PRIprepr": ", cgpu->proc_repr);
|
|
|
+ snprintf(buf, bufsz, " %*s: ", -(5 + max_lpdigits), cgpu->proc_repr);
|
|
|
else
|
|
|
snprintf(buf, bufsz, " %s: ", cgpu->dev_repr);
|
|
|
}
|
|
|
@@ -4202,7 +4204,7 @@ one_workable_pool: ;
|
|
|
{
|
|
|
int offset = 8 /* device */ + 5 /* temperature */ + 1 /* padding space */;
|
|
|
if (opt_show_procs && !opt_compact)
|
|
|
- ++offset; // proc letter
|
|
|
+ offset += max_lpdigits; // proc letter(s)
|
|
|
if (have_unicode_degrees)
|
|
|
++offset; // degrees symbol
|
|
|
mvwadd_wch(statuswin, 6, offset, WACS_PLUS);
|
|
|
@@ -8292,7 +8294,7 @@ static void hashmeter(int thr_id, struct timeval *diff,
|
|
|
|
|
|
divx = 7;
|
|
|
if (opt_show_procs && !opt_compact)
|
|
|
- ++divx;
|
|
|
+ divx += max_lpdigits;
|
|
|
|
|
|
if (bad)
|
|
|
{
|
|
|
@@ -9156,7 +9158,6 @@ static struct work *hash_pop(void)
|
|
|
{
|
|
|
struct work *work = NULL, *tmp;
|
|
|
int hc;
|
|
|
- struct timespec ts;
|
|
|
|
|
|
retry:
|
|
|
mutex_lock(stgd_lock);
|
|
|
@@ -9174,9 +9175,9 @@ retry:
|
|
|
staged_full = false; // Let it fill up before triggering an underrun again
|
|
|
no_work = true;
|
|
|
}
|
|
|
- ts = (struct timespec){ .tv_sec = opt_log_interval, };
|
|
|
pthread_cond_signal(&gws_cond);
|
|
|
- if (ETIMEDOUT == pthread_cond_timedwait(&getq->cond, stgd_lock, &ts))
|
|
|
+ const struct timeval tv = { .tv_sec = opt_log_interval, };
|
|
|
+ if (ETIMEDOUT == bfg_cond_timedwait(&getq->cond, stgd_lock, &tv))
|
|
|
{
|
|
|
run_cmd(cmd_idle);
|
|
|
pthread_cond_signal(&gws_cond);
|
|
|
@@ -11479,6 +11480,9 @@ void renumber_cgpu(struct cgpu_info *cgpu)
|
|
|
for (int i = lpcount; i > 26 && lpdigits < 3; i /= 26)
|
|
|
++lpdigits;
|
|
|
|
|
|
+ if (lpdigits > max_lpdigits)
|
|
|
+ max_lpdigits = lpdigits;
|
|
|
+
|
|
|
memset(&cgpu->proc_repr[5], 'a', lpdigits);
|
|
|
cgpu->proc_repr[5 + lpdigits] = '\0';
|
|
|
ns = strlen(cgpu->proc_repr_ns);
|
|
|
@@ -12337,10 +12341,10 @@ int main(int argc, char *argv[])
|
|
|
rwlock_init(&devices_lock);
|
|
|
|
|
|
mutex_init(&lp_lock);
|
|
|
- if (unlikely(pthread_cond_init(&lp_cond, NULL)))
|
|
|
+ if (unlikely(pthread_cond_init(&lp_cond, bfg_condattr)))
|
|
|
quit(1, "Failed to pthread_cond_init lp_cond");
|
|
|
|
|
|
- if (unlikely(pthread_cond_init(&gws_cond, NULL)))
|
|
|
+ if (unlikely(pthread_cond_init(&gws_cond, bfg_condattr)))
|
|
|
quit(1, "Failed to pthread_cond_init gws_cond");
|
|
|
|
|
|
notifier_init(submit_waiting_notifier);
|