Browse Source

take_queued_work_bymidstate should use a write lock.

nfactor-troky
Con Kolivas 11 years ago
parent
commit
5bf9856a4a
  1. 4
      cgminer.c

4
cgminer.c

@ -6178,11 +6178,11 @@ struct work *take_queued_work_bymidstate(struct cgpu_info *cgpu, char *midstate, @@ -6178,11 +6178,11 @@ struct work *take_queued_work_bymidstate(struct cgpu_info *cgpu, char *midstate,
{
struct work *work;
rd_lock(&cgpu->qlock);
wr_lock(&cgpu->qlock);
work = __find_work_bymidstate(cgpu->queued_work, midstate, midstatelen, data, offset, datalen);
if (work)
__work_completed(cgpu, work);
rd_unlock(&cgpu->qlock);
wr_unlock(&cgpu->qlock);
return work;
}

Loading…
Cancel
Save