mirror of
https://github.com/GOSTSec/sgminer
synced 2025-03-09 12:11:02 +00:00
Only restart threads that are not stuck waiting on lp staged work, and add one mandatory queued work item for each restart.
This commit is contained in:
parent
7e38a37a54
commit
ba4ba7f65c
10
main.c
10
main.c
@ -1924,8 +1924,16 @@ static void *watchdog_thread(void *userdata)
|
|||||||
for (i = 0; i < mining_threads; i++) {
|
for (i = 0; i < mining_threads; i++) {
|
||||||
struct thr_info *thr = &thr_info[i];
|
struct thr_info *thr = &thr_info[i];
|
||||||
|
|
||||||
if (now.tv_sec - thr->last.tv_sec > 60) {
|
/* Do not kill threads waiting on longpoll staged work */
|
||||||
|
if (now.tv_sec - thr->last.tv_sec > 60 && !lp_staged) {
|
||||||
applog(LOG_ERR, "Attempting to restart thread %d, idle for more than 60 seconds", i);
|
applog(LOG_ERR, "Attempting to restart thread %d, idle for more than 60 seconds", i);
|
||||||
|
/* Create one mandatory work item */
|
||||||
|
inc_staged(1, true);
|
||||||
|
if (unlikely(!queue_request())) {
|
||||||
|
applog(LOG_ERR, "Failed to queue_request in watchdog_thread");
|
||||||
|
kill_work();
|
||||||
|
break;
|
||||||
|
}
|
||||||
reinit_thread(i);
|
reinit_thread(i);
|
||||||
applog(LOG_WARNING, "Thread %d restarted", i);
|
applog(LOG_WARNING, "Thread %d restarted", i);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user