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

Discard work that is stale in the get_queued() function, returning NULL instead.

This commit is contained in:
Con Kolivas 2014-01-31 21:51:34 +11:00 committed by Noel Maersk
parent 8592226ad2
commit 2cea7ce439

View File

@ -6327,9 +6327,15 @@ struct work *get_queued(struct cgpu_info *cgpu)
wr_lock(&cgpu->qlock);
if (cgpu->unqueued_work) {
work = cgpu->unqueued_work;
if (unlikely(stale_work(work, false))) {
discard_work(work);
work = NULL;
goto out_unlock;
}
__add_queued(cgpu, work);
cgpu->unqueued_work = NULL;
}
out_unlock:
wr_unlock(&cgpu->qlock);
return work;