mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-05 11:34:16 +00:00
Make threads report out when they're queueing a request and report if they've failed.
This commit is contained in:
parent
324dd93bb7
commit
380d145c64
10
main.c
10
main.c
@ -2179,7 +2179,7 @@ static bool queue_request(void)
|
|||||||
/* fill out work request message */
|
/* fill out work request message */
|
||||||
wc = calloc(1, sizeof(*wc));
|
wc = calloc(1, sizeof(*wc));
|
||||||
if (unlikely(!wc)) {
|
if (unlikely(!wc)) {
|
||||||
applog(LOG_ERR, "Failed to tq_pop in queue_request");
|
applog(LOG_ERR, "Failed to calloc wc in queue_request");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2617,10 +2617,12 @@ static void *miner_thread(void *userdata)
|
|||||||
|
|
||||||
timeval_subtract(&diff, &tv_end, &tv_workstart);
|
timeval_subtract(&diff, &tv_end, &tv_workstart);
|
||||||
if (!requested && (diff.tv_sec >= request_interval)) {
|
if (!requested && (diff.tv_sec >= request_interval)) {
|
||||||
|
thread_reportout(mythr);
|
||||||
if (unlikely(!queue_request())) {
|
if (unlikely(!queue_request())) {
|
||||||
applog(LOG_ERR, "Failed to queue_request in miner_thread %d", thr_id);
|
applog(LOG_ERR, "Failed to queue_request in miner_thread %d", thr_id);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
thread_reportin(mythr);
|
||||||
requested = true;
|
requested = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2634,6 +2636,8 @@ static void *miner_thread(void *userdata)
|
|||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
thread_reportin(mythr);
|
||||||
|
applog(LOG_ERR, "Thread %d failure, exiting", thr_id);
|
||||||
tq_freeze(mythr->q);
|
tq_freeze(mythr->q);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -2920,10 +2924,12 @@ static void *gpuminer_thread(void *userdata)
|
|||||||
hash_div = (MAXTHREADS / total_hashes) ? : 1;
|
hash_div = (MAXTHREADS / total_hashes) ? : 1;
|
||||||
#endif
|
#endif
|
||||||
if (diff.tv_sec > request_interval || work->blk.nonce > request_nonce) {
|
if (diff.tv_sec > request_interval || work->blk.nonce > request_nonce) {
|
||||||
|
thread_reportout(mythr);
|
||||||
if (unlikely(!queue_request())) {
|
if (unlikely(!queue_request())) {
|
||||||
applog(LOG_ERR, "Failed to queue_request in gpuminer_thread %d", thr_id);
|
applog(LOG_ERR, "Failed to queue_request in gpuminer_thread %d", thr_id);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
thread_reportin(mythr);
|
||||||
requested = true;
|
requested = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2935,6 +2941,8 @@ static void *gpuminer_thread(void *userdata)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
|
thread_reportin(mythr);
|
||||||
|
applog(LOG_ERR, "Thread %d failure, exiting", thr_id);
|
||||||
tq_freeze(mythr->q);
|
tq_freeze(mythr->q);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user