Browse Source

Fix bad lock

djm34
Jan Berdajs 10 years ago
parent
commit
92deefcbca
  1. 8
      sgminer.c

8
sgminer.c

@ -486,13 +486,13 @@ static FILE *sharelog_file = NULL;
static struct cgpu_info *get_thr_cgpu(int thr_id) static struct cgpu_info *get_thr_cgpu(int thr_id)
{ {
struct thr_info *thr = NULL; struct cgpu_info *cgpu = NULL;
rd_lock(&mining_thr_lock); rd_lock(&mining_thr_lock);
if (thr_id < mining_threads) if (thr_id < mining_threads && mining_thr[thr_id])
thr = mining_thr[thr_id]; cgpu = mining_thr[thr_id]->cgpu;
rd_unlock(&mining_thr_lock); rd_unlock(&mining_thr_lock);
return thr ? thr->cgpu : NULL; return cgpu;
} }
struct cgpu_info *get_devices(int id) struct cgpu_info *get_devices(int id)

Loading…
Cancel
Save