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:
parent
8592226ad2
commit
2cea7ce439
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user