mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-03 10:35:03 +00:00
immediately exit threads if doing hard reset
This commit is contained in:
parent
19fcb5eae7
commit
deacbdd65e
12
sgminer.c
12
sgminer.c
@ -6505,7 +6505,8 @@ static void get_work_prepare_thread(struct thr_info *mythr, struct work *work)
|
|||||||
if (unlikely(pthread_create(&restart_thr, NULL, restart_mining_threads_thread, (void *) (intptr_t) n_threads)))
|
if (unlikely(pthread_create(&restart_thr, NULL, restart_mining_threads_thread, (void *) (intptr_t) n_threads)))
|
||||||
quit(1, "restart_mining_threads create thread failed");
|
quit(1, "restart_mining_threads create thread failed");
|
||||||
|
|
||||||
// go wait with the other threads...
|
applog(LOG_DEBUG, "Hard reset: Exiting mining thread %d", mythr->id);
|
||||||
|
pthread_exit(NULL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -6521,9 +6522,16 @@ static void get_work_prepare_thread(struct thr_info *mythr, struct work *work)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
|
bool hard_reset = opt_isset(pool_switch_options, SWITCHER_HARD_RESET);
|
||||||
mutex_unlock(&algo_switch_lock);
|
mutex_unlock(&algo_switch_lock);
|
||||||
|
|
||||||
|
if (hard_reset) {
|
||||||
|
applog(LOG_DEBUG, "Hard reset: Exiting mining thread %d", mythr->id);
|
||||||
|
pthread_exit(NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
|
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
|
||||||
|
|
||||||
// Set cleanup instructions in the event that the thread is cancelled
|
// Set cleanup instructions in the event that the thread is cancelled
|
||||||
|
Loading…
x
Reference in New Issue
Block a user