From 5bf9856a4aebab98499b5ea7224523d2314483d1 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Tue, 3 Sep 2013 11:38:58 +1000 Subject: [PATCH] take_queued_work_bymidstate should use a write lock. --- cgminer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cgminer.c b/cgminer.c index fc611a49..3b9e3ba0 100644 --- a/cgminer.c +++ b/cgminer.c @@ -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; }