mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-27 23:14:21 +00:00
Only free the thread structures if the thread still exists.
This commit is contained in:
parent
40bc82d4ca
commit
6f905932af
9
main.c
9
main.c
@ -3149,15 +3149,16 @@ static void *reinit_gpu(void *userdata)
|
||||
thr = &thr_info[thr_id];
|
||||
thr->rolling = thr->cgpu->rolling = 0;
|
||||
tq_freeze(thr->q);
|
||||
if (!pthread_cancel(*thr->pth))
|
||||
if (!pthread_cancel(*thr->pth)) {
|
||||
pthread_join(*thr->pth, NULL);
|
||||
free(thr->q);
|
||||
free(thr->q);
|
||||
free(clStates[thr_id]);
|
||||
}
|
||||
|
||||
thr->q = tq_new();
|
||||
if (!thr->q)
|
||||
quit(1, "Failed to tq_new in reinit_gputhread");
|
||||
|
||||
free(clStates[thr_id]);
|
||||
|
||||
applog(LOG_INFO, "Reinit GPU thread %d", thr_id);
|
||||
clStates[thr_id] = initCl(gpu, name, sizeof(name));
|
||||
if (!clStates[thr_id]) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user