mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-02 01:44:23 +00:00
Slowly remove work even if it's not being used to keep the getwork counter incrementing even if work is not used and as a test that pools are still working.
This commit is contained in:
parent
5dad99caf6
commit
117c032b92
12
sgminer.c
12
sgminer.c
@ -5761,6 +5761,9 @@ static struct work *hash_pop(void)
|
|||||||
|
|
||||||
/* Signal hash_pop again in case there are mutliple hash_pop waiters */
|
/* Signal hash_pop again in case there are mutliple hash_pop waiters */
|
||||||
pthread_cond_signal(&getq->cond);
|
pthread_cond_signal(&getq->cond);
|
||||||
|
|
||||||
|
/* Keep track of last getwork grabbed */
|
||||||
|
last_getwork = time(NULL);
|
||||||
mutex_unlock(stgd_lock);
|
mutex_unlock(stgd_lock);
|
||||||
|
|
||||||
return work;
|
return work;
|
||||||
@ -5920,7 +5923,6 @@ struct work *get_work(struct thr_info *thr, const int thr_id)
|
|||||||
wake_gws();
|
wake_gws();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
last_getwork = time(NULL);
|
|
||||||
applog(LOG_DEBUG, "Got work from get queue to get work for thread %d", thr_id);
|
applog(LOG_DEBUG, "Got work from get queue to get work for thread %d", thr_id);
|
||||||
|
|
||||||
work->thr_id = thr_id;
|
work->thr_id = thr_id;
|
||||||
@ -8155,8 +8157,14 @@ begin_bench:
|
|||||||
}
|
}
|
||||||
mutex_unlock(stgd_lock);
|
mutex_unlock(stgd_lock);
|
||||||
|
|
||||||
if (ts > max_staged)
|
if (ts > max_staged) {
|
||||||
|
/* Keeps slowly generating work even if it's not being
|
||||||
|
* used to keep last_getwork incrementing and to see
|
||||||
|
* if pools are still alive. */
|
||||||
|
work = hash_pop();
|
||||||
|
discard_work(work);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
work = make_work();
|
work = make_work();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user