1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-02-08 21:14:14 +00:00

take_queued_work_bymidstate should use a write lock.

This commit is contained in:
Con Kolivas 2013-09-03 11:38:58 +10:00
parent 4b3fe8f056
commit 5bf9856a4a

View File

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