mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-05 11:34:16 +00:00
Remove disabled: label from mining thread function, using a separate mt_disable function.
This commit is contained in:
parent
af809b79be
commit
1d153a140f
29
cgminer.c
29
cgminer.c
@ -3989,6 +3989,20 @@ static inline bool abandon_work(struct work *work, struct timeval *wdiff, uint64
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void mt_disable(struct thr_info *mythr, const int thr_id,
|
||||||
|
struct device_api *api)
|
||||||
|
{
|
||||||
|
applog(LOG_WARNING, "Thread %d being disabled", thr_id);
|
||||||
|
mythr->rolling = mythr->cgpu->rolling = 0;
|
||||||
|
applog(LOG_DEBUG, "Popping wakeup ping in miner thread");
|
||||||
|
thread_reportout(mythr);
|
||||||
|
tq_pop(mythr->q, NULL); /* Ignore ping that's popped */
|
||||||
|
thread_reportin(mythr);
|
||||||
|
applog(LOG_WARNING, "Thread %d being re-enabled", thr_id);
|
||||||
|
if (api->thread_enable)
|
||||||
|
api->thread_enable(mythr);
|
||||||
|
}
|
||||||
|
|
||||||
void *miner_thread(void *userdata)
|
void *miner_thread(void *userdata)
|
||||||
{
|
{
|
||||||
struct thr_info *mythr = userdata;
|
struct thr_info *mythr = userdata;
|
||||||
@ -4111,7 +4125,7 @@ void *miner_thread(void *userdata)
|
|||||||
cgpu->device_not_well_reason = REASON_THREAD_ZERO_HASH;
|
cgpu->device_not_well_reason = REASON_THREAD_ZERO_HASH;
|
||||||
cgpu->thread_zero_hash_count++;
|
cgpu->thread_zero_hash_count++;
|
||||||
|
|
||||||
goto disabled;
|
mt_disable(mythr, thr_id, api);
|
||||||
}
|
}
|
||||||
|
|
||||||
hashes_done += hashes;
|
hashes_done += hashes;
|
||||||
@ -4169,17 +4183,8 @@ void *miner_thread(void *userdata)
|
|||||||
tv_lastupdate = tv_end;
|
tv_lastupdate = tv_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unlikely(mythr->pause || cgpu->deven != DEV_ENABLED)) {
|
if (unlikely(mythr->pause || cgpu->deven != DEV_ENABLED))
|
||||||
applog(LOG_WARNING, "Thread %d being disabled", thr_id);
|
mt_disable(mythr, thr_id, api);
|
||||||
disabled:
|
|
||||||
mythr->rolling = mythr->cgpu->rolling = 0;
|
|
||||||
applog(LOG_DEBUG, "Popping wakeup ping in miner thread");
|
|
||||||
thread_reportout(mythr);
|
|
||||||
tq_pop(mythr->q, NULL); /* Ignore ping that's popped */
|
|
||||||
thread_reportin(mythr);
|
|
||||||
applog(LOG_WARNING, "Thread %d being re-enabled", thr_id);
|
|
||||||
if (api->thread_enable) api->thread_enable(mythr);
|
|
||||||
}
|
|
||||||
|
|
||||||
sdiff.tv_sec = sdiff.tv_usec = 0;
|
sdiff.tv_sec = sdiff.tv_usec = 0;
|
||||||
} while (!abandon_work(work, &wdiff, cgpu->max_hashes));
|
} while (!abandon_work(work, &wdiff, cgpu->max_hashes));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user