mirror of
https://github.com/GOSTSec/sgminer
synced 2025-09-09 12:42:05 +00:00
Only pthread_join the mining threads if they exist as determined by pthread_cancel.
This commit is contained in:
parent
3cb7ef2b07
commit
a1339d723f
15
main.c
15
main.c
@ -1880,13 +1880,8 @@ static void reinit_cputhread(int thr_id)
|
|||||||
struct thr_info *thr = &thr_info[thr_id];
|
struct thr_info *thr = &thr_info[thr_id];
|
||||||
|
|
||||||
tq_freeze(thr->q);
|
tq_freeze(thr->q);
|
||||||
if (unlikely(pthread_cancel(thr->pth))) {
|
if (!(pthread_cancel(thr->pth)) && pthread_join(thr->pth, NULL)) {
|
||||||
applog(LOG_ERR, "Failed to pthread_cancel in reinit_gputhread");
|
applog(LOG_ERR, "Failed to pthread_join in reinit_cputhread");
|
||||||
goto failed_out;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (unlikely(pthread_join(thr->pth, NULL))) {
|
|
||||||
applog(LOG_ERR, "Failed to pthread_join in reinit_gputhread");
|
|
||||||
goto failed_out;
|
goto failed_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1913,11 +1908,7 @@ static void reinit_gputhread(int thr_id)
|
|||||||
char name[256];
|
char name[256];
|
||||||
|
|
||||||
tq_freeze(thr->q);
|
tq_freeze(thr->q);
|
||||||
if (unlikely(pthread_cancel(thr->pth))) {
|
if (!(pthread_cancel(thr->pth)) && pthread_join(thr->pth, NULL)) {
|
||||||
applog(LOG_ERR, "Failed to pthread_cancel in reinit_gputhread");
|
|
||||||
goto failed_out;
|
|
||||||
}
|
|
||||||
if (unlikely(pthread_join(thr->pth, NULL))) {
|
|
||||||
applog(LOG_ERR, "Failed to pthread_join in reinit_gputhread");
|
applog(LOG_ERR, "Failed to pthread_join in reinit_gputhread");
|
||||||
goto failed_out;
|
goto failed_out;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user