Browse Source

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

port-ckolivas
Con Kolivas 11 years ago committed by Noel Maersk
parent
commit
2cea7ce439
  1. 6
      sgminer.c

6
sgminer.c

@ -6327,9 +6327,15 @@ struct work *get_queued(struct cgpu_info *cgpu) @@ -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…
Cancel
Save