From 77f9400ca20e4bfb64216b8b7badb86d8bd2642e Mon Sep 17 00:00:00 2001 From: ckolivas Date: Wed, 21 Aug 2013 12:15:40 +1000 Subject: [PATCH] Only display the no pool work message once if there are multiple waiters in hash_pop --- cgminer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cgminer.c b/cgminer.c index 0c98f616..fd70bb81 100644 --- a/cgminer.c +++ b/cgminer.c @@ -5495,7 +5495,10 @@ static struct work *hash_pop(void) then.tv_sec = now.tv_sec + 5; then.tv_nsec = now.tv_usec * 1000; rc = pthread_cond_timedwait(&getq->cond, stgd_lock, &then); - if (rc) { + /* Check again for !no_work as multiple threads may be + * waiting on this condition and another may set the + * bool separately. */ + if (rc && !no_work) { applog(LOG_WARNING, "Waiting for work to be available from pools."); no_work = true; }