mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 07:17:58 +00:00
Do not hold the mining thread lock in restart_threads when calling the driver flush work commands.
This commit is contained in:
parent
b5eddd1159
commit
e9f20f5e0b
@ -3675,7 +3675,7 @@ static void restart_threads(void)
|
||||
{
|
||||
struct pool *cp = current_pool();
|
||||
struct cgpu_info *cgpu;
|
||||
int i;
|
||||
int i, mt;
|
||||
|
||||
/* Artificially set the lagging flag to avoid pool not providing work
|
||||
* fast enough messages after every long poll */
|
||||
@ -3685,7 +3685,10 @@ static void restart_threads(void)
|
||||
discard_stale();
|
||||
|
||||
rd_lock(&mining_thr_lock);
|
||||
for (i = 0; i < mining_threads; i++) {
|
||||
mt = mining_threads;
|
||||
rd_unlock(&mining_thr_lock);
|
||||
|
||||
for (i = 0; i < mt; i++) {
|
||||
cgpu = mining_thr[i]->cgpu;
|
||||
if (unlikely(!cgpu))
|
||||
continue;
|
||||
@ -3695,7 +3698,6 @@ static void restart_threads(void)
|
||||
flush_queue(cgpu);
|
||||
cgpu->drv->flush_work(cgpu);
|
||||
}
|
||||
rd_unlock(&mining_thr_lock);
|
||||
|
||||
mutex_lock(&restart_lock);
|
||||
pthread_cond_broadcast(&restart_cond);
|
||||
|
Loading…
Reference in New Issue
Block a user