mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-31 08:54:19 +00:00
Fix bad lock
This commit is contained in:
parent
40894db5d2
commit
92deefcbca
@ -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…
x
Reference in New Issue
Block a user