Browse Source

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

djm34
Jan Berdajs 11 years ago
parent
commit
e58cd00db7
  1. 6
      sgminer.c

6
sgminer.c

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

Loading…
Cancel
Save