1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-11 15:27:53 +00:00

fix bug in thread_reportin (watchdog can detect getwork is false before thr->last is set), and a few cosmetic changes

This commit is contained in:
Jan Berdajs 2014-06-05 18:35:46 +02:00
parent b8a1c1f660
commit e58cd00db7

View File

@ -5187,8 +5187,8 @@ static void *api_thread(void *userdata)
* only across get_work. */
static void thread_reportin(struct thr_info *thr)
{
thr->getwork = false;
cgtime(&thr->last);
thr->getwork = false;
thr->cgpu->status = LIFE_WELL;
thr->cgpu->device_last_well = time(NULL);
}
@ -5197,8 +5197,8 @@ static void thread_reportin(struct thr_info *thr)
* be restarted */
static void thread_reportout(struct thr_info *thr)
{
thr->getwork = true;
cgtime(&thr->last);
thr->getwork = true;
thr->cgpu->status = LIFE_WELL;
thr->cgpu->device_last_well = time(NULL);
}
@ -5220,7 +5220,7 @@ static void hashmeter(int thr_id, struct timeval *diff,
/* Update the last time this thread reported in */
if (thr_id >= 0) {
thr = get_thread(thr_id);
cgtime(&(thr->last));
cgtime(&thr->last);
thr->cgpu->device_last_well = time(NULL);
}