1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-31 00:44:19 +00:00

Fix bad lock

This commit is contained in:
Jan Berdajs 2014-07-01 01:19:07 +02:00
parent 40894db5d2
commit 92deefcbca

View File

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